Skip to content

Commit

Permalink
Fix: Plugin activator didn't run
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaydsouza committed Aug 17, 2023
1 parent 01b6fe1 commit 7f5405e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
2 changes: 0 additions & 2 deletions includes/admin/class-activator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class Activator {
* @since 3.3.0
*/
public function __construct() {
register_activation_hook( TOP_TEN_PLUGIN_FILE, array( __CLASS__, 'activation_hook' ) );

add_filter( 'wpmu_drop_tables', array( __CLASS__, 'on_delete_blog' ) );
add_action( 'plugins_loaded', array( __CLASS__, 'update_db_check' ) );

Expand Down
1 change: 1 addition & 0 deletions includes/admin/settings/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ public static function settings_counter() {
'desc' => esc_html__( 'Uncheck above to disable tracking if the current user falls into any one of these groups.', 'top-10' ),
'type' => 'multicheck',
'default' => array(
'authors' => 'authors',
'editors' => 'editors',
'admins' => 'admins',
),
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=== Top 10 - Popular posts plugin for WordPress ===
=== Top 10 - WordPress Popular posts by WebberZone ===
Tags: popular posts, top 10, counter, top posts, daily popular, page views, statistics, tracker
Contributors: webberzone, Ajay
Donate link: https://ajaydsouza.com/donate/
Expand Down Expand Up @@ -143,6 +143,10 @@ Top 10 is one of the many plugins developed by WebberZone. Check out our other p

== Changelog ==

= 3.3.2 =

* Fix: Plugin activator function didn't run on activation - Top 10's database tables were not created

= 3.3.1 =

* Enhancements/Modifications:
Expand Down
21 changes: 18 additions & 3 deletions top-10.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Count daily and total visits per post and display the most popular posts based on the number of views.
*
* @package Top_Ten
* @author Ajay D'Souza <me@ajaydsouza.com>
* @author Ajay D'Souza
* @license GPL-2.0+
* @link https://webberzone.com
* @copyright 2008-2023 Ajay D'Souza
Expand All @@ -14,8 +14,8 @@
* Plugin Name: Top 10
* Plugin URI: https://webberzone.com/plugins/top-10/
* Description: Count daily and total visits per post and display the most popular posts based on the number of views
* Version: 3.3.1
* Author: Ajay D'Souza
* Version: 3.3.2-beta1
* Author: WebberZone
* Author URI: https://webberzone.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
Expand Down Expand Up @@ -89,8 +89,23 @@
// Load the autoloader.
require_once TOP_TEN_PLUGIN_DIR . 'includes/autoloader.php';


/**
* The code that runs during plugin activation.
*
* @since 3.3.2
*
* @param bool $network_wide Whether the plugin is being activated network-wide.
*/
function activate_tptn( $network_wide ) {
\WebberZone\Top_Ten\Admin\Activator::activation_hook( $network_wide );
}
register_activation_hook( __FILE__, __NAMESPACE__ . '\activate_tptn' );

/**
* The main function responsible for returning the one true WebberZone Snippetz instance to functions everywhere.
*
* @since 3.3.0
*/
function load_tptn() {
\WebberZone\Top_Ten\Main::get_instance();
Expand Down

0 comments on commit 7f5405e

Please sign in to comment.