PluginProbe
WP Data Access – App Builder for Tables, Forms, Dashboards, Charts & Maps / 5.5.87
WP Data Access – App Builder for Tables, Forms, Dashboards, Charts & Maps v5.5.87
5.5.87 5.5.85 5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 All 162 releases
← All changes | wp-data-access.php +123 -7 5.5.77 → 5.5.87 View file →
@@ -3,9 +3,9 @@
3 3 /**
4 4 * Plugin Name: WP Data Access
5 5 * Plugin URI: https://wpdataaccess.com/
6 6 * Description: A powerful data-driven App Builder with an intuitive Table Builder, a highly customizable Form Builder and interactive Chart support in 35 languages
7 - * Version: 5.5.77
7 + * Version: 5.5.87
8 8 * Author: Passionate Programmers B.V.
9 9 * Author URI: https://wpdataaccess.com/
10 10 * Text Domain: wp-data-access
11 11 * License: GPL-2.0+
@@ -55,8 +55,9 @@
55 55 'slug' => 'wpda_navi',
56 56 'contact' => false,
57 57 'network' => true,
58 58 ),
59 + 'has_affiliation' => 'all',
59 60 'is_live' => true,
60 61 'is_org_compliant' => true,
61 62 ) );
62 63 }
@@ -67,21 +68,67 @@
67 68 wpda_freemius();
68 69 // Signal that SDK was initiated.
69 70 do_action( 'wpda_freemius_loaded' );
70 71 /**
71 - * Change plugin settings info
72 - *
72 + * Check if legacy tools are currently used on this server.
73 + * @return bool
74 + */
75 + function wpda_has_legacy_tools_inuse() {
76 + $option_legacy_tools = WPDA::get_option( WPDA::OPTION_PLUGIN_LEGACY_TOOLS );
77 + $has_legacy_tools = false;
78 + if ( !empty( $option_legacy_tools ) && is_array( $option_legacy_tools ) ) {
79 + foreach ( $option_legacy_tools as $tool ) {
80 + if ( isset( $tool[0] ) && $tool[0] === true && isset( $tool[1] ) && $tool[1] > 0 ) {
81 + $has_legacy_tools = true;
82 + break;
83 + }
84 + }
85 + }
86 + return $has_legacy_tools;
87 + }
88 +
89 + /**
90 + * Hook into the plugin_row_meta filter.
73 91 * @param mixed $links Links.
74 92 * @param mixed $file File.
93 + * @param mixed $data Data.
75 94 * @return mixed
76 95 */
77 - function wpda_row_meta( $links, $file ) {
78 - if ( strpos( $file, plugin_basename( __FILE__ ) ) !== false ) {
96 + function wpda_row_meta( $links, $file, $data ) {
97 + if ( plugin_basename( __FILE__ ) == $file ) {
79 98 // Add settings link.
80 99 $settings_url = admin_url( 'options-general.php' ) . '?page=wpdataaccess';
81 - $settings_link = "<a href='{$settings_url}'>Settings</a>";
100 + $settings_link = '<a href="' . esc_url( $settings_url ) . '">Settings</a>';
82 101 array_push( $links, $settings_link );
83 102 // phpcs:ignore -- 8.1 proof
103 + // Add comment for legacy users only
104 + if ( wpda_has_legacy_tools_inuse() ) {
105 + if ( isset( $data['new_version'] ) ) {
106 + $new_version = $data['new_version'];
107 + if ( version_compare( $new_version, '6.0', '>=' ) ) {
108 + $notice = '
109 + <p style="margin-top: 10px; margin-bottom: 0; padding: 6px 10px; border-radius: 2px;"
110 + class="update-message notice inline notice-warning notice-alt"
111 + >
112 + <span class="dashicons dashicons-warning" style="color: #f0b849;"></span>
113 + <strong>Warning for legacy users:</strong> Version ' . esc_html( $new_version ) . ' (available now) removes legacy tools.
114 + <strong style="color: #cc1818;">Stay on Version 5.x</strong> to keep using them.
115 + <a href="https://docs.legacy.wpdataaccess.com/docs/deprecating/" target="_blank">Read more →</a>
116 + </p>';
117 + } else {
118 + $notice = '
119 + <p style="margin-top: 10px; margin-bottom: 0; padding: 6px 10px; border-radius: 2px;"
120 + class="update-message notice inline notice-info notice-alt"
121 + >
122 + <span class="dashicons dashicons-info" style="color: #3858e9;"></span>
123 + <strong>Info for legacy users:</strong> Version 6 is coming soon and removes legacy tools.
124 + <strong>Stay on Version 5.x</strong> to keep using them.
125 + <a href="https://docs.legacy.wpdataaccess.com/docs/deprecating/" target="_blank">Read more →</a>
126 + </p>';
127 + }
128 + $links[] = $notice;
129 + }
130 + }
84 131 }
85 132 return $links;
86 133 }
87 134
@@ -88,11 +135,63 @@
88 135 add_filter(
89 136 'plugin_row_meta',
90 137 'wpda_row_meta',
91 138 10,
92 - 2
139 + 3
93 140 );
94 141 /**
142 + * Remove last | character from plugin links.
143 + * @return void
144 + */
145 + function wpda_clean_plugin_row_script() {
146 + if ( !wpda_has_legacy_tools_inuse() ) {
147 + return;
148 + }
149 + ?>
150 + <script type="text/javascript">
151 + jQuery(document).ready(function($) {
152 + var $row = $('tr[data-slug="wp-data-access"] .plugin-version-author-uri');
153 + if ($row.length) {
154 + $row.contents().each(function(index) {
155 + if (this.nodeType === 3 && index === 6) {
156 + this.nodeValue = this.nodeValue.replace(/\|/g, '');
157 + }
158 + });
159 + }
160 + });
161 + </script>
162 + <?php
163 + }
164 +
165 + add_action( 'admin_footer-plugins.php', 'wpda_clean_plugin_row_script' );
166 + /**
167 + * Show legacy tools info widget.
168 + * @return void
169 + */
170 + function wpda_legacy_tools_notice_widget() {
171 + // Add widget for legacy users only
172 + if ( wpda_has_legacy_tools_inuse() ) {
173 + wp_add_dashboard_widget( 'wporg_dashboard_widget', 'WP Data Access - Info for legacy tools users', function () {
174 + ?>
175 + <p>
176 + Version 6 is coming soon and removes legacy tools.
177 + </p>
178 + <p>
179 + <strong>To keep using the legacy tools:</strong><br>
180 + ✓ Stay on the latest Version 5.x<br>
181 + ✓ Disable auto-updates<br>
182 + ✓ Do not update manually to Version 6
183 + </p>
184 + <p>
185 + <a href="https://docs.legacy.wpdataaccess.com/docs/deprecating/" target="_blank">Read more →</a>
186 + </p>
187 + <?php
188 + } );
189 + }
190 + }
191 +
192 + add_action( 'wp_dashboard_setup', 'wpda_legacy_tools_notice_widget' );
193 + /**
95 194 * Activate plugin
96 195 *
97 196 * @author Peter Schulz
98 197 * @since 1.0.0
@@ -180,8 +279,21 @@
180 279 }
181 280 // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQLPlaceholders, WordPress.DB.DirectDatabaseQuery.SchemaChange
182 281 }
183 282
283 + function wpda_unschedule_event( $hook ) {
284 + $crons = _get_cron_array();
285 + foreach ( $crons as $timestamp => $cron ) {
286 + if ( isset( $cron[$hook] ) ) {
287 + foreach ( $cron[$hook] as $event ) {
288 + if ( isset( $event['args'] ) ) {
289 + wp_unschedule_event( $timestamp, $hook, $event['args'] );
290 + }
291 + }
292 + }
293 + }
294 + }
295 +
184 296 /**
185 297 * Uninstall WP Data Access tables, options and meta keys
186 298 *
187 299 * @return void
@@ -203,8 +315,12 @@
203 315 // Uninstall on single site installation.
204 316 wpda_uninstall_blog();
205 317 }
206 318 WPDA::wpda_delete_content_folder();
319 + // Unscheduled all WP Data Access events
320 + wpda_unschedule_event( 'wpda_data_backup' );
321 + wpda_unschedule_event( \WPDataAccess\Query_Builder\WPDA_Query_Builder_Scheduler::SCHEDULER_HOOK_NAME );
322 + wpda_unschedule_event( \WPDataAccess\Utilities\WPDA_Export_Scheduler::SCHEDULER_HOOK_NAME );
207 323 }
208 324
209 325 wpda_freemius()->add_action( 'after_uninstall', 'wpda_uninstall' );
210 326 /**