PluginProbe
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder / 1.4.4
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder v1.4.4
3.6.0 3.5.0 trunk 1.0.10 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.6.1 1.0.7 1.0.8 1.0.9 1.1 1.1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.5 1.5.1 All 110 releases
buttonizer-multifunctional-button / freemius / templates / debug / scheduled-crons.php

scheduled-crons.php in Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder 1.4.4, at freemius/templates/debug/scheduled-crons.php

138 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6 * @since 1.1.7.3
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 $fs_options = FS_Option_Manager::get_manager( WP_FS__ACCOUNTS_OPTION_NAME, true );
14 $plugins = $fs_options->get_option( 'plugins' );
15 $scheduled_crons = array();
16
17 $module_types = array(
18 WP_FS__MODULE_TYPE_PLUGIN,
19 WP_FS__MODULE_TYPE_THEME
20 );
21
22 foreach ( $module_types as $module_type ) {
23 $modules = $fs_options->get_option( $module_type . 's' );
24 if ( is_array( $modules ) && count( $modules ) > 0 ) {
25 foreach ( $modules as $slug => $data ) {
26 if ( WP_FS__MODULE_TYPE_THEME === $module_type ) {
27 $current_theme = wp_get_theme();
28 $is_active = ( $current_theme->stylesheet === $data->file );
29 } else {
30 $is_active = is_plugin_active( $data->file );
31 }
32
33 /**
34 * @author Vova Feldman
35 *
36 * @since 1.2.1 Don't load data from inactive modules.
37 */
38 if ( $is_active ) {
39 $fs = freemius( $data->id );
40
41 $next_execution = $fs->next_sync_cron();
42 $last_execution = $fs->last_sync_cron();
43
44 if ( false !== $next_execution ) {
45 $scheduled_crons[ $slug ][] = array(
46 'name' => $fs->get_plugin_name(),
47 'slug' => $slug,
48 'module_type' => $fs->get_module_type(),
49 'type' => 'sync_cron',
50 'last' => $last_execution,
51 'next' => $next_execution,
52 );
53 }
54
55 $next_install_execution = $fs->next_install_sync();
56 $last_install_execution = $fs->last_install_sync();
57
58 if (false !== $next_install_execution ||
59 false !== $last_install_execution
60 ) {
61 $scheduled_crons[ $slug ][] = array(
62 'name' => $fs->get_plugin_name(),
63 'slug' => $slug,
64 'module_type' => $fs->get_module_type(),
65 'type' => 'install_sync',
66 'last' => $last_install_execution,
67 'next' => $next_install_execution,
68 );
69 }
70 }
71 }
72 }
73 }
74
75 $sec_text = fs_text_x_inline( 'sec', 'seconds' );
76 ?>
77 <h1><?php fs_esc_html_echo_inline( 'Scheduled Crons' ) ?></h1>
78 <table class="widefat">
79 <thead>
80 <tr>
81 <th><?php fs_esc_html_echo_inline( 'Slug' ) ?></th>
82 <th><?php fs_esc_html_echo_inline( 'Module' ) ?></th>
83 <th><?php fs_esc_html_echo_inline( 'Module Type' ) ?></th>
84 <th><?php fs_esc_html_echo_inline( 'Cron Type' ) ?></th>
85 <th><?php fs_esc_html_echo_inline( 'Last' ) ?></th>
86 <th><?php fs_esc_html_echo_inline( 'Next' ) ?></th>
87 </tr>
88 </thead>
89 <tbody>
90 <?php
91 /* translators: %s: time period (e.g. In "2 hours") */
92 $in_x_text = fs_text_inline( 'In %s', 'in-x' );
93 /* translators: %s: time period (e.g. "2 hours" ago) */
94 $x_ago_text = fs_text_inline( '%s ago', 'x-ago' );
95 ?>
96 <?php foreach ( $scheduled_crons as $slug => $crons ) : ?>
97 <?php foreach ( $crons as $cron ) : ?>
98 <tr>
99 <td><?php echo $slug ?></td>
100 <td><?php echo $cron['name'] ?></td>
101 <td><?php echo $cron['module_type'] ?></td>
102 <td><?php echo $cron['type'] ?></td>
103 <td><?php
104 if ( is_numeric( $cron['last'] ) ) {
105 $diff = abs( WP_FS__SCRIPT_START_TIME - $cron['last'] );
106 $human_diff = ( $diff < MINUTE_IN_SECONDS ) ?
107 $diff . ' ' . $sec_text :
108 human_time_diff( WP_FS__SCRIPT_START_TIME, $cron['last'] );
109
110 echo esc_html( sprintf(
111 ( ( WP_FS__SCRIPT_START_TIME < $cron['last'] ) ?
112 $in_x_text :
113 $x_ago_text ),
114 $human_diff
115 ) );
116 }
117 ?></td>
118 <td><?php
119 if ( is_numeric( $cron['next'] ) ) {
120 $diff = abs( WP_FS__SCRIPT_START_TIME - $cron['next'] );
121 $human_diff = ( $diff < MINUTE_IN_SECONDS ) ?
122 $diff . ' ' . $sec_text :
123 human_time_diff( WP_FS__SCRIPT_START_TIME, $cron['next'] );
124
125 echo esc_html( sprintf(
126 ( ( WP_FS__SCRIPT_START_TIME < $cron['next'] ) ?
127 $in_x_text :
128 $x_ago_text ),
129 $human_diff
130 ) );
131 }
132 ?></td>
133 </tr>
134 <?php endforeach ?>
135 <?php endforeach ?>
136 </tbody>
137 </table>
138