Skip to content
Snippets Groups Projects
Select Git revision
  • 72e1b4c435aae02be496e58bb4e7eefe900f2803
  • master default protected
  • feat/npm-publish
  • feat/demo-deploy
  • change-demo-deploy
  • remove-smoke
  • feat/acceptance-tests
  • feature/deploy-composer.json
  • feature/mysql-bin-logs
  • skip-codecept-for-libs
  • include-composer-json
  • exclude-wp-assets
  • update_codecept_image
  • fix/silenced-copy
  • remove-free-translations
  • codeception-with-optional-step
  • improve-parallelization
  • linter-exit
  • change-images
  • fix/linter
  • globally-raise-mem-limit
  • no-symlink2
22 results

gitlab-ci-1.2.yml

Blame
  • Reminder.php 1.52 KiB
    <?php
    
    namespace ReminderNamespace;
    
    class Reminder {
    
    	private $logo_url = 'logo-url';
    
    	public function __construct() {
    		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_reminder_script' ) );
    		add_action( 'admin_footer', array( $this, 'display_html_element' ) );
    	}
    
    	public function enqueue_reminder_script() {
    		if ( ! $this->is_plugin_activated() ) {
    			wp_register_script(
    				'wpdesk-activation-reminder',
    				plugins_url( 'popup-javascript-file' ),
    				array(),
    				'script-version',
    				true
    			);
    			wp_enqueue_script( 'wpdesk-activation-reminder' );
    
    			wp_register_style(
    				'wpdesk-activation-reminder',
    				plugins_url( 'popup-css-file' ),
    				array(),
    				'script-version'
    			);
    			wp_enqueue_style( 'wpdesk-activation-reminder' );
    		}
    	}
    
    	public function display_html_element() {
    		if ( ! $this->is_plugin_activated() ) {
    			$logo_url          = plugins_url( 'plugin-dir' . '/' . $this->logo_url );
    			$cookie_name       = md5( site_url() );
    			$subscriptions_url = admin_url( 'admin.php?page=wpdesk-licenses' );
    			$read_more_url     = 'https://flexibleshipping.com';
    			echo "<span class=\"wpdesk-activation-reminder\" data-plugin_title=\"plugin-title\" data-plugin_dir=\"plugin-dir\" data-logo_url=\"$logo_url\" data-cookie_name=\"$cookie_name\" data-subscriptions_url=\"$subscriptions_url\" data-buy_plugin_url=\"buy-plugin-url\" data-read_more_url=\"$read_more_url\"></span>";
    		}
    	}
    
    	private function is_plugin_activated() {
    		return get_option( 'api_plugin-dir_activated', '' ) === 'Activated';
    	}
    
    }
    
    new Reminder();