PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.7.3
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.7.3
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Module/Setup.php +18 -0 3.7.23.7.3 View file →
@@ -52,8 +52,10 @@
52 52 $this->_addAction( 'plugins_loaded', 'loadTextDomain' );
53 53 $this->_addFilter( 'visualizer_logger_data', 'getLoggerData' );
54 54 $this->_addFilter( 'visualizer_get_chart_counts', 'getUsage', 10, 2 );
55 55
56 + $this->_addAction( 'init', 'checkIsExistingUser' );
57 +
56 58 // only for testing
57 59 // $this->_addAction( 'admin_init', 'getUsage' );
58 60 }
59 61 /**
@@ -402,7 +404,23 @@
402 404 $hours = get_post_meta( $chart_id, Visualizer_Plugin::CF_DB_SCHEDULE, true );
403 405 $new_schedules[ $chart_id ] = time() + $hours * HOUR_IN_SECONDS;
404 406 }
405 407 update_option( Visualizer_Plugin::CF_DB_SCHEDULE, $new_schedules );
408 + }
409 +
410 + /**
411 + * Save flag for existing users.
412 + */
413 + public function checkIsExistingUser() {
414 + $chart_exists = get_option( 'visualizer-new-user', '' );
415 + if ( '' === $chart_exists ) {
416 + $charts = get_posts(
417 + array(
418 + 'post_type' => Visualizer_Plugin::CPT_VISUALIZER,
419 + 'fields' => 'ids',
420 + )
421 + );
422 + update_option( 'visualizer-new-user', ! empty( $charts ) ? 'no' : 'yes' );
423 + }
406 424 }
407 425
408 426 }