/** * Singleton pattern * * @return class Singleton instance */ public static function getInstance($parent) { if (!self::$_instance) { self::$_instance = new self($parent); } return self::$_instance; }
private function printBaseInterface() { global $wpdb; ?> <link rel='stylesheet' href='<?php echo $this->module_folder; ?> app.css' type='text/css' media='all' /> <div id="AmazonWooCommerce-wrapper" class="fluid wrapper-AmazonWooCommerce AmazonWooCommerce-asset-download"> <?php // show the top menu AmazonWooCommerceAdminMenu::getInstance()->make_active('info|assets_download')->show_menu(); ?> <!-- Content --> <div id="AmazonWooCommerce-content"> <h1 class="AmazonWooCommerce-section-headline"> <?php if (isset($this->module['assets_download']['in_dashboard']['icon'])) { echo '<img src="' . ($this->module_folder . $this->module['assets_download']['in_dashboard']['icon']) . '" class="AmazonWooCommerce-headline-icon">'; } ?> <?php echo $this->module['assets_download']['menu']['title']; ?> <span class="AmazonWooCommerce-section-info"><?php echo $this->module['assets_download']['description']; ?> </span> <?php $has_help = isset($this->module['assets_download']['help']) ? true : false; if ($has_help === true) { $help_type = isset($this->module['assets_download']['help']['type']) && $this->module['assets_download']['help']['type'] ? 'remote' : 'local'; if ($help_type == 'remote') { echo '<a href="#load_docs" class="AmazonWooCommerce-show-docs" data-helptype="' . $help_type . '" data-url="' . $this->module['assets_download']['help']['url'] . '">HELP</a>'; } } //echo '<a href="#load_docs" class="AmazonWooCommerce-show-feedback" data-helptype="' . ( 'remote' ) . '" data-url="' . ( $this->the_plugin->feedback_url ) . '" data-operation="feedback">Feedback</a>'; ?> </h1> <!-- Main loading box --> <div id="AmazonWooCommerce-main-loading"> <div id="AmazonWooCommerce-loading-overlay"></div> <div id="AmazonWooCommerce-loading-box"> <div class="AmazonWooCommerce-loading-text"><?php _e('Loading', $this->the_plugin->localizationName); ?> </div> <div class="AmazonWooCommerce-meter AmazonWooCommerce-animate" style="width:86%; margin: 34px 0px 0px 7%;"><span style="width:100%"></span></div> </div> </div> <!-- Container --> <div class="AmazonWooCommerce-container clearfix"> <!-- Main Content Wrapper --> <div id="AmazonWooCommerce-content-wrap" class="clearfix" style="padding-top: 5px;"> <!-- Content Area --> <div id="AmazonWooCommerce-content-area"> <div class="AmazonWooCommerce-grid_4"> <div class="AmazonWooCommerce-panel"> <div class="AmazonWooCommerce-panel-header"> <span class="AmazonWooCommerce-panel-title"> <?php _e('Assets Download', $this->the_plugin->localizationName); ?> </span> </div> <div class="AmazonWooCommerce-panel-content"> <form class="AmazonWooCommerce-form" action="#save_with_ajax"> <div class="AmazonWooCommerce-form-row AmazonWooCommerce-table-ajax-list" id="AmazonWooCommerce-table-ajax-response"> <?php AmazonWooCommerceAjaxListTable::getInstance($this->the_plugin)->setup(array('id' => 'AmazonWooCommerceAssetDownload', 'show_header' => true, 'search_box' => false, 'items_per_page' => 5, 'post_statuses' => array('publish' => __('Published', $this->the_plugin->localizationName)), 'custom_table' => 'amz_products', 'columns' => array('id' => array('th' => __('Post', $this->the_plugin->localizationName), 'td' => '%post_id%', 'width' => '50'), 'action' => array('th' => __('Delete Asset', $this->the_plugin->localizationName), 'td' => '%del_asset%', 'width' => '50'), 'assets' => array('th' => __('Assets', $this->the_plugin->localizationName), 'td' => '%post_assets%', 'align' => 'left'))))->print_html(); ?> </div> </form> </div> </div> </div> <div class="clear"></div> <div class="AmazonWooCommerce-grid_4"> <div class="AmazonWooCommerce-panel"> <div class="AmazonWooCommerce-panel-header"> <span class="AmazonWooCommerce-panel-title"> <?php _e('OR create cron job for doing the assets download jobs', $this->the_plugin->localizationName); ?> </span> </div> <div class="AmazonWooCommerce-panel-content"> <div class="AmazonWooCommerce-sync-details"> <p>To configure a real cron job, you will need access to your cPanel or Admin panel (we will be using cPanel in this tutorial).</p> <p>1. Log into your cPanel.</p> <p>2. Scroll down the list of applications until you see the “<em>cron jobs</em>” link. Click on it.</p> <p><img width="510" height="192" class="aligncenter size-full wp-image-81" alt="wpcron-cpanel" src="<?php echo $this->the_plugin->cfg['paths']['plugin_dir_url'] . 'aa-framework'; ?> /images/wpcron-cpanel.png"></p> <p>3. Under the <em>Add New Cron Job</em> section, choose the interval that you want it to run the cron job. I have set it to run every 15minutes, but you can change it according to your liking.</p> <p><img width="470" height="331" class="aligncenter size-full wp-image-82" alt="wpcron-add-new-cron-job" src="<?php echo $this->the_plugin->cfg['paths']['plugin_dir_url'] . 'aa-framework/'; ?> /images/wpcron-add-new-cron-job.png"></p> <p>4. In the Command field, enter the following:</p> <div class="wp_syntax"><div class="code"><pre style="font-family:monospace;" class="bash"><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-q</span> <span style="color: #660033;">-O</span> - </span><?php echo admin_url('admin-ajax.php?action=AmazonWooAssetsCron'); ?> <span style="color: #000000; font-weight: bold;">>/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">>&</span><span style="color: #000000;">1</span></pre></div></div> <p>5. Click the “Add New Cron Job” button. You should now see a message like this:</p> <p>8. Save and upload (and replace) this file back to the server. This will disable WordPress internal cron job.</p> <p>That’s it.</p> </div> </div> </div> </div> </div> </div> </div> </div> </div> <script type="text/javascript" src="<?php echo $this->module_folder; ?> app.class.js" ></script> <?php }
private function printBaseInterface() { global $wpdb; ?> <script type="text/javascript" src="<?php echo $this->module_folder; ?> app.class.js" ></script> <div id="AmazonWooCommerce-wrapper" class="fluid wrapper-AmazonWooCommerce"> <?php // show the top menu AmazonWooCommerceAdminMenu::getInstance()->make_active('info|stats_prod')->show_menu(); ?> <!-- Content --> <div id="AmazonWooCommerce-content"> <h1 class="AmazonWooCommerce-section-headline"> <?php if (isset($this->module['stats_prod']['in_dashboard']['icon'])) { echo '<img src="' . ($this->module_folder . $this->module['stats_prod']['in_dashboard']['icon']) . '" class="AmazonWooCommerce-headline-icon">'; } ?> <?php echo $this->module['stats_prod']['menu']['title']; ?> <span class="AmazonWooCommerce-section-info"><?php echo $this->module['stats_prod']['description']; ?> </span> <?php $has_help = isset($this->module['stats_prod']['help']) ? true : false; if ($has_help === true) { $help_type = isset($this->module['stats_prod']['help']['type']) && $this->module['stats_prod']['help']['type'] ? 'remote' : 'local'; if ($help_type == 'remote') { echo '<a href="#load_docs" class="AmazonWooCommerce-show-docs" data-helptype="' . $help_type . '" data-url="' . $this->module['stats_prod']['help']['url'] . '">HELP</a>'; } } echo '<a href="#load_docs" class="AmazonWooCommerce-show-feedback" data-helptype="' . 'remote' . '" data-url="' . $this->the_plugin->feedback_url . '" data-operation="feedback">Feedback</a>'; ?> </h1> <!-- Main loading box --> <div id="AmazonWooCommerce-main-loading"> <div id="AmazonWooCommerce-loading-overlay"></div> <div id="AmazonWooCommerce-loading-box"> <div class="AmazonWooCommerce-loading-text"><?php _e('Loading', $this->the_plugin->localizationName); ?> </div> <div class="AmazonWooCommerce-meter AmazonWooCommerce-animate" style="width:86%; margin: 34px 0px 0px 7%;"><span style="width:100%"></span></div> </div> </div> <!-- Container --> <div class="AmazonWooCommerce-container clearfix" style="position: relative;"> <?php //echo $this->the_plugin->premium_message('row-large'); ?> <!-- Main Content Wrapper --> <div id="AmazonWooCommerce-content-wrap" class="clearfix"> <!-- Content Area --> <div id="AmazonWooCommerce-content-area"> <div class="AmazonWooCommerce-grid_4"> <div class="AmazonWooCommerce-panel"> <div class="AmazonWooCommerce-panel-content"> <form class="AmazonWooCommerce-form" action="#save_with_ajax"> <div class="AmazonWooCommerce-form-row AmazonWooCommerce-table-ajax-list" id="AmazonWooCommerce-table-ajax-response"> <?php AmazonWooCommerceAjaxListTable::getInstance($this->the_plugin)->setup(array('id' => 'AmazonWooCommercePriceUpdateMonitor', 'show_header' => true, 'search_box' => false, 'items_per_page' => '15', 'post_statuses' => array('publish' => __('Published', $this->the_plugin->localizationName)), 'list_post_types' => array('product'), 'columns' => array('id' => array('th' => __('ID', $this->the_plugin->localizationName), 'td' => '%ID%', 'width' => '40'), 'thumb' => array('th' => __('Thumb', $this->the_plugin->localizationName), 'td' => '%thumb%', 'align' => 'center', 'width' => '50'), 'asin' => array('th' => __('ASIN', $this->the_plugin->localizationName), 'td' => '%asin%', 'align' => 'center', 'width' => '70'), 'title' => array('th' => __('Title', $this->the_plugin->localizationName), 'td' => '%title%', 'align' => 'left'), 'hits' => array('th' => __('Hits', $this->the_plugin->localizationName), 'td' => '%hits%', 'align' => 'center', 'width' => '70'), 'redirected_to_amazon' => array('th' => __('Redirected to Amazon', $this->the_plugin->localizationName), 'td' => '%redirected_to_amazon%', 'align' => 'center', 'width' => '140'), 'date' => array('th' => __('Date Added', $this->the_plugin->localizationName), 'td' => '%date%', 'width' => '120'))))->print_html(); ?> </div> </form> </div> </div> </div> <div class="clear"></div> </div> </div> </div> </div> </div> <?php }