diff --git a/autoupdate-self.php b/autoupdate-self.php index 4d4b7ed23678d..f1823f0140c34 100644 --- a/autoupdate-self.php +++ b/autoupdate-self.php @@ -26,9 +26,9 @@ public function __construct() { } $this->config = array( - 'plugin_file' => 'jetpack-beta/jetpack-beta.php', - 'slug' => 'jetpack-beta', - 'proper_folder_name' => 'jetpack-beta', + 'plugin_file' => JPBETA__PLUGIN_FOLDER . '/jetpack-beta.php', + 'slug' => JPBETA__PLUGIN_FOLDER, + 'proper_folder_name' => JPBETA__PLUGIN_FOLDER, 'api_url' => 'https://api.github.com/repos/Automattic/jetpack-beta', 'github_url' => 'https://github.com/Automattic/jetpack-beta', 'requires' => '4.7', @@ -180,7 +180,7 @@ public function upgrader_source_selection( $source, $remote_source, $upgrader ) } return $source; } - + public function auto_update_jetpack_beta( $update, $item ) { if ( 'sure' !== get_option( 'jp_beta_autoupdate') ) { return $update; diff --git a/jetpack-beta-admin.php b/jetpack-beta-admin.php index a326d6c096560..af34c6b9026d5 100644 --- a/jetpack-beta-admin.php +++ b/jetpack-beta-admin.php @@ -17,7 +17,7 @@ static function add_actions() { add_action( "load-$hook", array( __CLASS__, 'admin_page_load' ) ); add_action( "admin_print_styles-$hook", array( __CLASS__, 'admin_styles' ) ); add_action( "admin_print_scripts-$hook", array( __CLASS__, 'admin_scripts' ) ); - add_filter( 'plugin_action_links_' . plugin_basename( 'jetpack-beta/jetpack-beta.php' ), array( __CLASS__, 'admin_plugin_settings_link' ) ); + add_filter( 'plugin_action_links_' . JPBETA__PLUGIN_FOLDER . '/jetpack-beta.php', array( __CLASS__, 'admin_plugin_settings_link' ) ); } static function get_page_hook() { diff --git a/jetpack-beta.php b/jetpack-beta.php index 17c05d156afe0..043b89a7d56dd 100644 --- a/jetpack-beta.php +++ b/jetpack-beta.php @@ -35,7 +35,7 @@ * Jetpack beta manages files inside jetpack-dev folder this folder should contain * */ -define( 'JPBETA__PLUGIN_FOLDER', plugins_url() . '/jetpack-beta/' ); +define( 'JPBETA__PLUGIN_FOLDER', basename( __DIR__ ) ); define( 'JPBETA__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'JPBETA__PLUGIN_FILE', __FILE__ ); define( 'JPBETA_VERSION', 2 );