Changeset 1946605
- Timestamp:
- 09/25/2018 08:20:02 AM (8 years ago)
- Location:
- storespot
- Files:
-
- 6 added
- 5 edited
- 5 copied
-
tags/1.0.3 (copied) (copied from storespot/trunk)
-
tags/1.0.3/admin/class-storespot-api.php (copied) (copied from storespot/trunk/admin/class-storespot-api.php)
-
tags/1.0.3/admin/class-storespot-messages.php (added)
-
tags/1.0.3/img (added)
-
tags/1.0.3/img/logo.png (added)
-
tags/1.0.3/includes/class-storespot-activator.php (copied) (copied from storespot/trunk/includes/class-storespot-activator.php) (3 diffs)
-
tags/1.0.3/includes/class-storespot.php (modified) (3 diffs)
-
tags/1.0.3/readme.txt (copied) (copied from storespot/trunk/readme.txt) (4 diffs)
-
tags/1.0.3/storespot.php (copied) (copied from storespot/trunk/storespot.php) (2 diffs)
-
trunk/admin/class-storespot-messages.php (added)
-
trunk/img (added)
-
trunk/img/logo.png (added)
-
trunk/includes/class-storespot-activator.php (modified) (3 diffs)
-
trunk/includes/class-storespot.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/storespot.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
storespot/tags/1.0.3/includes/class-storespot-activator.php
r1944778 r1946605 2 2 3 3 class StoreSpot_Activator { 4 4 5 public static function activate() { 6 5 7 $options = [ 6 8 'pixel_id' => '', … … 8 10 'product_category' => '' 9 11 ]; 12 10 13 add_option( 'storespot_settings', $options ); 11 14 set_transient( 'stsp-admin-activation-notice', true, 5 ); … … 14 17 wp_schedule_event( time(), 'hourly', 'stsp_product_feed_update' ); 15 18 } 19 16 20 } 21 17 22 } -
storespot/tags/1.0.3/includes/class-storespot.php
r1939129 r1946605 42 42 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-storespot-loader.php'; 43 43 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-storespot-product-feed.php'; 44 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-storespot-messages.php'; 44 45 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-storespot-api.php'; 45 46 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-storespot-events.php'; … … 50 51 private function define_admin_hooks() { 51 52 $product_feed = new StoreSpot_Product_Feed(); 53 $admin_message = new StoreSpot_Messages(); 52 54 $this->loader->add_action( 'update_option_storespot_settings', $product_feed, 'write_product_feed' ); 53 55 $this->loader->add_action( 'stsp_product_feed_update', $product_feed, 'write_product_feed' ); 56 $this->loader->add_action( 'admin_notices', $admin_message, 'activation_notice' ); 54 57 } 55 58 56 59 private function define_public_hooks() { 57 60 $plugin_public = new StoreSpot_Events( $this->get_plugin_name(), $this->get_version() ); 58 if( $plugin_public->facebook_pixel->get_pixel_id() ) { 61 $pixel_id = $plugin_public->facebook_pixel->get_pixel_id(); 62 if( $pixel_id && ! $this->fb_integration_installed( $pixel_id ) ) { 59 63 $this->loader->add_action( 'wp_head', $plugin_public, 'render_facebook_pixel' ); 60 64 $this->loader->add_action( 'wp_head', $plugin_public, 'render_facebook_pixel_noscript' ); … … 68 72 $this->loader->add_action( 'wc_ajax_render_add_to_cart_event', $plugin_public, 'render_ajax_add_to_cart_event' ); 69 73 } 74 } 75 76 private function fb_integration_installed($pixel_id) { 77 $fb_option = get_option('facebook_config'); 78 if ( $fb_option && array_key_exists( 'pixel_id' ) ) { 79 if ( $fb_option['pixel_id'] == $pixel_id) { 80 return true; 81 } 82 } 83 84 return false; 70 85 } 71 86 -
storespot/tags/1.0.3/readme.txt
r1945614 r1946605 5 5 Tested up to: 4.9 6 6 Requires PHP: 5.6 7 Stable tag: 1.0. 27 Stable tag: 1.0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 > **Note:** This plugin is only really of use to you if you have a StoreSpot account. [**Create one now**](https://storespot.io )15 > **Note:** This plugin is only really of use to you if you have a StoreSpot account. [**Create one now**](https://storespot.io?ref=wporg) 16 16 17 17 --- … … 39 39 Install and activate the plugin, and we take care of the rest! 40 40 41 You need a StoreSpot account to work with this plugin. If you don't have one yet, go visit [StoreSpot](https://www.storespot.io )41 You need a StoreSpot account to work with this plugin. If you don't have one yet, go visit [StoreSpot](https://www.storespot.io?ref=wporg) 42 42 43 43 … … 49 49 50 50 == Changelog == 51 52 = 1.0.3 = 53 * Extended admin notices 54 * Add integration with official Facebook plugin 51 55 52 56 = 1.0.2 = -
storespot/tags/1.0.3/storespot.php
r1945614 r1946605 4 4 * Plugin URI: https://storespot.io/ 5 5 * Description: Stop leaving money on the table. Automate your retargeting ads with StoreSpot. 6 * Version: 1.0. 26 * Version: 1.0.3 7 7 * Author: StoreSpot 8 8 **/ 9 9 10 10 if ( ! defined( 'ABSPATH' ) ) { exit; } 11 12 11 if ( ! defined( 'WPINC' ) ) { die; } 13 12 … … 24 23 } 25 24 26 function stsp_admin_activation_notice() {27 /* Check transient, if available display notice */28 if( get_transient( 'stsp-admin-activation-notice' ) ){29 ?>30 <div class="updated notice is-dismissible">31 <p>32 Thank you for installing <strong>StoreSpot</strong>!33 You can now go close this tab and finish setting up your34 account in the StoreSpot app.35 </p>36 </div>37 <?php38 /* Delete transient, only display this notice once. */39 delete_transient( 'stsp-admin-activation-notice' );40 }41 }42 43 25 register_activation_hook( __FILE__, 'activate_storespot' ); 44 26 register_deactivation_hook( __FILE__, 'deactivate_storespot' ); 45 add_action( 'admin_notices', 'stsp_admin_activation_notice' );46 27 47 28 require plugin_dir_path( __FILE__ ) . 'includes/class-storespot.php'; -
storespot/trunk/includes/class-storespot-activator.php
r1944778 r1946605 2 2 3 3 class StoreSpot_Activator { 4 4 5 public static function activate() { 6 5 7 $options = [ 6 8 'pixel_id' => '', … … 8 10 'product_category' => '' 9 11 ]; 12 10 13 add_option( 'storespot_settings', $options ); 11 14 set_transient( 'stsp-admin-activation-notice', true, 5 ); … … 14 17 wp_schedule_event( time(), 'hourly', 'stsp_product_feed_update' ); 15 18 } 19 16 20 } 21 17 22 } -
storespot/trunk/includes/class-storespot.php
r1939129 r1946605 42 42 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-storespot-loader.php'; 43 43 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-storespot-product-feed.php'; 44 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-storespot-messages.php'; 44 45 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-storespot-api.php'; 45 46 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-storespot-events.php'; … … 50 51 private function define_admin_hooks() { 51 52 $product_feed = new StoreSpot_Product_Feed(); 53 $admin_message = new StoreSpot_Messages(); 52 54 $this->loader->add_action( 'update_option_storespot_settings', $product_feed, 'write_product_feed' ); 53 55 $this->loader->add_action( 'stsp_product_feed_update', $product_feed, 'write_product_feed' ); 56 $this->loader->add_action( 'admin_notices', $admin_message, 'activation_notice' ); 54 57 } 55 58 56 59 private function define_public_hooks() { 57 60 $plugin_public = new StoreSpot_Events( $this->get_plugin_name(), $this->get_version() ); 58 if( $plugin_public->facebook_pixel->get_pixel_id() ) { 61 $pixel_id = $plugin_public->facebook_pixel->get_pixel_id(); 62 if( $pixel_id && ! $this->fb_integration_installed( $pixel_id ) ) { 59 63 $this->loader->add_action( 'wp_head', $plugin_public, 'render_facebook_pixel' ); 60 64 $this->loader->add_action( 'wp_head', $plugin_public, 'render_facebook_pixel_noscript' ); … … 68 72 $this->loader->add_action( 'wc_ajax_render_add_to_cart_event', $plugin_public, 'render_ajax_add_to_cart_event' ); 69 73 } 74 } 75 76 private function fb_integration_installed($pixel_id) { 77 $fb_option = get_option('facebook_config'); 78 if ( $fb_option && array_key_exists( 'pixel_id' ) ) { 79 if ( $fb_option['pixel_id'] == $pixel_id) { 80 return true; 81 } 82 } 83 84 return false; 70 85 } 71 86 -
storespot/trunk/readme.txt
r1945614 r1946605 5 5 Tested up to: 4.9 6 6 Requires PHP: 5.6 7 Stable tag: 1.0. 27 Stable tag: 1.0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 > **Note:** This plugin is only really of use to you if you have a StoreSpot account. [**Create one now**](https://storespot.io )15 > **Note:** This plugin is only really of use to you if you have a StoreSpot account. [**Create one now**](https://storespot.io?ref=wporg) 16 16 17 17 --- … … 39 39 Install and activate the plugin, and we take care of the rest! 40 40 41 You need a StoreSpot account to work with this plugin. If you don't have one yet, go visit [StoreSpot](https://www.storespot.io )41 You need a StoreSpot account to work with this plugin. If you don't have one yet, go visit [StoreSpot](https://www.storespot.io?ref=wporg) 42 42 43 43 … … 49 49 50 50 == Changelog == 51 52 = 1.0.3 = 53 * Extended admin notices 54 * Add integration with official Facebook plugin 51 55 52 56 = 1.0.2 = -
storespot/trunk/storespot.php
r1945614 r1946605 4 4 * Plugin URI: https://storespot.io/ 5 5 * Description: Stop leaving money on the table. Automate your retargeting ads with StoreSpot. 6 * Version: 1.0. 26 * Version: 1.0.3 7 7 * Author: StoreSpot 8 8 **/ 9 9 10 10 if ( ! defined( 'ABSPATH' ) ) { exit; } 11 12 11 if ( ! defined( 'WPINC' ) ) { die; } 13 12 … … 24 23 } 25 24 26 function stsp_admin_activation_notice() {27 /* Check transient, if available display notice */28 if( get_transient( 'stsp-admin-activation-notice' ) ){29 ?>30 <div class="updated notice is-dismissible">31 <p>32 Thank you for installing <strong>StoreSpot</strong>!33 You can now go close this tab and finish setting up your34 account in the StoreSpot app.35 </p>36 </div>37 <?php38 /* Delete transient, only display this notice once. */39 delete_transient( 'stsp-admin-activation-notice' );40 }41 }42 43 25 register_activation_hook( __FILE__, 'activate_storespot' ); 44 26 register_deactivation_hook( __FILE__, 'deactivate_storespot' ); 45 add_action( 'admin_notices', 'stsp_admin_activation_notice' );46 27 47 28 require plugin_dir_path( __FILE__ ) . 'includes/class-storespot.php';
Note: See TracChangeset
for help on using the changeset viewer.