Changeset 3240028
- Timestamp:
- 02/13/2025 11:33:52 AM (12 months ago)
- Location:
- visidea
- Files:
-
- 215 added
- 3 edited
-
tags/2.1.14 (added)
-
tags/2.1.14/README.md (added)
-
tags/2.1.14/admin (added)
-
tags/2.1.14/admin/class-visidea-admin.php (added)
-
tags/2.1.14/admin/images (added)
-
tags/2.1.14/admin/images/visidea-icon.png (added)
-
tags/2.1.14/admin/images/visidea-logo.png (added)
-
tags/2.1.14/includes (added)
-
tags/2.1.14/includes/class-visidea-activator.php (added)
-
tags/2.1.14/includes/class-visidea-deactivator.php (added)
-
tags/2.1.14/includes/class-visidea-i18n.php (added)
-
tags/2.1.14/includes/class-visidea-loader.php (added)
-
tags/2.1.14/includes/class-visidea.php (added)
-
tags/2.1.14/index.php (added)
-
tags/2.1.14/lang (added)
-
tags/2.1.14/lang/visidea-it_IT.mo (added)
-
tags/2.1.14/lang/visidea-it_IT.po (added)
-
tags/2.1.14/lang/visidea.pot (added)
-
tags/2.1.14/libraries (added)
-
tags/2.1.14/libraries/action-scheduler (added)
-
tags/2.1.14/libraries/action-scheduler/.editorconfig (added)
-
tags/2.1.14/libraries/action-scheduler/.gitattributes (added)
-
tags/2.1.14/libraries/action-scheduler/.github (added)
-
tags/2.1.14/libraries/action-scheduler/.github/release-drafter.yml (added)
-
tags/2.1.14/libraries/action-scheduler/.github/workflows (added)
-
tags/2.1.14/libraries/action-scheduler/.github/workflows/pr-unit-tests.yml (added)
-
tags/2.1.14/libraries/action-scheduler/.gitignore (added)
-
tags/2.1.14/libraries/action-scheduler/Gruntfile.js (added)
-
tags/2.1.14/libraries/action-scheduler/README.md (added)
-
tags/2.1.14/libraries/action-scheduler/action-scheduler.php (added)
-
tags/2.1.14/libraries/action-scheduler/changelog.txt (added)
-
tags/2.1.14/libraries/action-scheduler/classes (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_ActionClaim.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_ActionFactory.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_AdminView.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_AsyncRequest_QueueRunner.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_Compatibility.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_DataController.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_DateTime.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_Exception.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_FatalErrorMonitor.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_InvalidActionException.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_ListTable.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_LogEntry.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_NullLogEntry.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_OptionLock.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_QueueCleaner.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_QueueRunner.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_Versions.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_WPCommentCleaner.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/ActionScheduler_wcSystemStatus.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/WP_CLI (added)
-
tags/2.1.14/libraries/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_Clean_Command.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_QueueRunner.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_Scheduler_command.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/WP_CLI/Migration_Command.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/WP_CLI/ProgressBar.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/abstracts (added)
-
tags/2.1.14/libraries/action-scheduler/classes/abstracts/ActionScheduler.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_RecurringSchedule.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_Schedule.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_Schema.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/abstracts/ActionScheduler_Lock.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/abstracts/ActionScheduler_Logger.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/abstracts/ActionScheduler_Store.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/abstracts/ActionScheduler_TimezoneHelper.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/actions (added)
-
tags/2.1.14/libraries/action-scheduler/classes/actions/ActionScheduler_Action.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/actions/ActionScheduler_CanceledAction.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/actions/ActionScheduler_FinishedAction.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/actions/ActionScheduler_NullAction.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/data-stores (added)
-
tags/2.1.14/libraries/action-scheduler/classes/data-stores/ActionScheduler_DBLogger.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/data-stores/ActionScheduler_wpCommentLogger.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore_PostStatusRegistrar.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore_PostTypeRegistrar.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore_TaxonomyRegistrar.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/migration (added)
-
tags/2.1.14/libraries/action-scheduler/classes/migration/ActionMigrator.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/migration/BatchFetcher.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/migration/Config.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/migration/Controller.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/migration/DryRun_ActionMigrator.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/migration/DryRun_LogMigrator.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/migration/LogMigrator.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/migration/Runner.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/migration/Scheduler.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/schedules (added)
-
tags/2.1.14/libraries/action-scheduler/classes/schedules/ActionScheduler_CanceledSchedule.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/schedules/ActionScheduler_CronSchedule.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/schedules/ActionScheduler_IntervalSchedule.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/schedules/ActionScheduler_NullSchedule.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/schedules/ActionScheduler_Schedule.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/schedules/ActionScheduler_SimpleSchedule.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/schema (added)
-
tags/2.1.14/libraries/action-scheduler/classes/schema/ActionScheduler_LoggerSchema.php (added)
-
tags/2.1.14/libraries/action-scheduler/classes/schema/ActionScheduler_StoreSchema.php (added)
-
tags/2.1.14/libraries/action-scheduler/codecov.yml (added)
-
tags/2.1.14/libraries/action-scheduler/composer.json (added)
-
tags/2.1.14/libraries/action-scheduler/composer.lock (added)
-
tags/2.1.14/libraries/action-scheduler/deprecated (added)
-
tags/2.1.14/libraries/action-scheduler/deprecated/ActionScheduler_Abstract_QueueRunner_Deprecated.php (added)
-
tags/2.1.14/libraries/action-scheduler/deprecated/ActionScheduler_AdminView_Deprecated.php (added)
-
tags/2.1.14/libraries/action-scheduler/deprecated/ActionScheduler_Schedule_Deprecated.php (added)
-
tags/2.1.14/libraries/action-scheduler/deprecated/ActionScheduler_Store_Deprecated.php (added)
-
tags/2.1.14/libraries/action-scheduler/deprecated/functions.php (added)
-
tags/2.1.14/libraries/action-scheduler/docs (added)
-
tags/2.1.14/libraries/action-scheduler/docs/CNAME (added)
-
tags/2.1.14/libraries/action-scheduler/docs/_config.yml (added)
-
tags/2.1.14/libraries/action-scheduler/docs/_layouts (added)
-
tags/2.1.14/libraries/action-scheduler/docs/_layouts/default.html (added)
-
tags/2.1.14/libraries/action-scheduler/docs/admin.md (added)
-
tags/2.1.14/libraries/action-scheduler/docs/android-chrome-192x192.png (added)
-
tags/2.1.14/libraries/action-scheduler/docs/android-chrome-256x256.png (added)
-
tags/2.1.14/libraries/action-scheduler/docs/api.md (added)
-
tags/2.1.14/libraries/action-scheduler/docs/apple-touch-icon.png (added)
-
tags/2.1.14/libraries/action-scheduler/docs/assets (added)
-
tags/2.1.14/libraries/action-scheduler/docs/assets/css (added)
-
tags/2.1.14/libraries/action-scheduler/docs/assets/css/style.scss (added)
-
tags/2.1.14/libraries/action-scheduler/docs/browserconfig.xml (added)
-
tags/2.1.14/libraries/action-scheduler/docs/faq.md (added)
-
tags/2.1.14/libraries/action-scheduler/docs/favicon-16x16.png (added)
-
tags/2.1.14/libraries/action-scheduler/docs/favicon-32x32.png (added)
-
tags/2.1.14/libraries/action-scheduler/docs/favicon.ico (added)
-
tags/2.1.14/libraries/action-scheduler/docs/google14ef723abb376cd3.html (added)
-
tags/2.1.14/libraries/action-scheduler/docs/index.md (added)
-
tags/2.1.14/libraries/action-scheduler/docs/mstile-150x150.png (added)
-
tags/2.1.14/libraries/action-scheduler/docs/perf.md (added)
-
tags/2.1.14/libraries/action-scheduler/docs/safari-pinned-tab.svg (added)
-
tags/2.1.14/libraries/action-scheduler/docs/site.webmanifest (added)
-
tags/2.1.14/libraries/action-scheduler/docs/usage.md (added)
-
tags/2.1.14/libraries/action-scheduler/docs/version3-0.md (added)
-
tags/2.1.14/libraries/action-scheduler/docs/wp-cli.md (added)
-
tags/2.1.14/libraries/action-scheduler/functions.php (added)
-
tags/2.1.14/libraries/action-scheduler/lib (added)
-
tags/2.1.14/libraries/action-scheduler/lib/WP_Async_Request.php (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression/CronExpression.php (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression/CronExpression_AbstractField.php (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression/CronExpression_DayOfMonthField.php (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression/CronExpression_DayOfWeekField.php (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression/CronExpression_FieldFactory.php (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression/CronExpression_FieldInterface.php (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression/CronExpression_HoursField.php (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression/CronExpression_MinutesField.php (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression/CronExpression_MonthField.php (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression/CronExpression_YearField.php (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression/LICENSE (added)
-
tags/2.1.14/libraries/action-scheduler/lib/cron-expression/README.md (added)
-
tags/2.1.14/libraries/action-scheduler/license.txt (added)
-
tags/2.1.14/libraries/action-scheduler/package-lock.json (added)
-
tags/2.1.14/libraries/action-scheduler/package.json (added)
-
tags/2.1.14/libraries/action-scheduler/phpcs.xml (added)
-
tags/2.1.14/libraries/action-scheduler/readme.txt (added)
-
tags/2.1.14/libraries/action-scheduler/tests (added)
-
tags/2.1.14/libraries/action-scheduler/tests/ActionScheduler_UnitTestCase.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/README.md (added)
-
tags/2.1.14/libraries/action-scheduler/tests/bin (added)
-
tags/2.1.14/libraries/action-scheduler/tests/bin/install.sh (added)
-
tags/2.1.14/libraries/action-scheduler/tests/bootstrap.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit.xml.dist (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/ActionScheduler_Mock_Async_Request_QueueRunner.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/ActionScheduler_Mocker.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/deprecated (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/deprecated/ActionScheduler_UnitTestCase.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/helpers (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/helpers/ActionScheduler_Callbacks.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/helpers/ActionScheduler_Compatibility_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/helpers/ActionScheduler_TimezoneHelper_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/jobs (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/jobs/ActionScheduler_Action_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/jobs/ActionScheduler_NullAction_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/jobstore (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/jobstore/AbstractStoreTest.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/jobstore/ActionScheduler_DBStoreMigrator_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/jobstore/ActionScheduler_DBStore_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/jobstore/ActionScheduler_HybridStore_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/jobstore/ActionScheduler_wpPostStore_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/lock (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/lock/ActionScheduler_OptionLock_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/logging (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/logging/ActionScheduler_DBLogger_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/logging/ActionScheduler_wpCommentLogger_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/migration (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/migration/ActionMigrator_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/migration/BatchFetcher_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/migration/Config_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/migration/Controller_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/migration/LogMigrator_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/migration/Runner_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/migration/Scheduler_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/procedural_api (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/procedural_api/procedural_api_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/procedural_api/wc_get_scheduled_actions_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/runner (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/runner/ActionScheduler_QueueCleaner_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/runner/ActionScheduler_QueueRunner_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/schedules (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/schedules/ActionScheduler_CronSchedule_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/schedules/ActionScheduler_IntervalSchedule_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/schedules/ActionScheduler_NullSchedule_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/schedules/ActionScheduler_SimpleSchedule_Test.php (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/versioning (added)
-
tags/2.1.14/libraries/action-scheduler/tests/phpunit/versioning/ActionScheduler_Versions_Test.php (added)
-
tags/2.1.14/public (added)
-
tags/2.1.14/public/class-visidea-public.php (added)
-
tags/2.1.14/readme.txt (added)
-
tags/2.1.14/visidea.php (added)
-
trunk/admin/class-visidea-admin.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/visidea.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
visidea/trunk/admin/class-visidea-admin.php
r3224275 r3240028 217 217 // Close the file and rename it 218 218 fclose($fp); 219 219 220 $old_filename = 'items_' . $options['private_token'] . '.csv'; 220 221 $hash_filename = 'items_' . $options['private_token'] . '.hash'; 221 222 unlink(plugin_dir_path(__FILE__) . $old_filename); 222 223 rename($file_path, plugin_dir_path(__FILE__) . $old_filename); 223 file_put_contents(plugin_dir_path(__FILE__) . $hash_filename, hash_file(' md5', plugin_dir_path(__FILE__) . $old_filename));224 file_put_contents(plugin_dir_path(__FILE__) . $hash_filename, hash_file('sha256', plugin_dir_path(__FILE__) . $old_filename)); 224 225 225 226 } catch (Exception $e) { … … 227 228 } 228 229 229 error_log('Visidea - cron_items_dump job finished at ' . date(DATE_RFC2822)); // Log start230 error_log('Visidea - cron_items_dump job finished at ' . date(DATE_RFC2822)); // Log end 230 231 231 232 } … … 353 354 354 355 public function cron_users_dump() { 355 // error_log( 'fired cron_users_dump at ' . date( DATE_RFC2822 ) ); 356 357 error_log('Visidea - cron_users_dump job started at ' . date(DATE_RFC2822)); // Log start 356 358 357 359 // Re-initialize items dump file … … 400 402 $file = plugin_dir_path(__FILE__) . $option_filename; 401 403 rename(plugin_dir_path(__FILE__) . $option_filename, plugin_dir_path(__FILE__) . $old_filename); 402 file_put_contents(plugin_dir_path(__FILE__) . $hash_filename, hash_file('md5', plugin_dir_path(__FILE__) . $old_filename)); 404 file_put_contents(plugin_dir_path(__FILE__) . $hash_filename, hash_file('sha256', plugin_dir_path(__FILE__) . $old_filename)); 405 406 error_log('Visidea - cron_users_dump job finished at ' . date(DATE_RFC2822)); // Log end 403 407 404 408 } … … 425 429 426 430 public function cron_interactions_dump() { 427 // error_log( 'fired cron_interactions_dump at ' . date( DATE_RFC2822 ) );428 429 // Initialize interactions file431 error_log('Visidea - cron_interactions_dump job started at ' . date(DATE_RFC2822)); // Log start 432 433 // Initialize file and options 430 434 $options = get_option('visidea_plugin_options'); 431 $option_filename = 'interactions_' .$options['private_token'].'.tmp';435 $option_filename = 'interactions_' . $options['private_token'] . '.tmp'; 432 436 $file = plugin_dir_path(__FILE__) . $option_filename; 433 $fp = fopen($file, 'w'); 434 435 // Write header 436 $interactions_columns = "item_id;action;user_id;price;quantity;timestamp\n"; 437 fwrite($fp, $interactions_columns); 438 439 for ($i=0; $i<356; $i++) { 440 // Get all previous orders 441 $start = 356 - $i; 442 $one_day = 24 * 60 * 60; 443 $today = strtotime( date('Y-m-d') ); 444 445 $query = new WC_Order_Query( array( 446 'limit' => -1, 447 'date_created' => ( $today - ( $start * $one_day ) ).'...'.( $today - ( $start * $one_day ) + $one_day ), 448 ) ); 449 $orders = $query->get_orders(); 450 451 foreach ($orders as $order) { 452 453 // Get customer ID 454 $user_id = $order->get_user_id(); 455 456 // Loop through order items and write them in the opened file 457 foreach ($order->get_items() as $item_id => $item) { 458 459 // Get product handle 460 $product = $item->get_product(); 461 462 // Get the product ID 463 if (is_object($product)) 464 $product_id = $product->get_id(); 465 else 466 $product_id = 0; 467 468 // Get item price and quantity 469 $item_price = $item->get_total(); // Total price for this item (quantity * unit price) 470 $item_quantity = $item->get_quantity(); // Quantity of the item in the order 471 472 // If all is set create the buffer 473 if ($product_id > 0 && !empty($user_id)) { 474 475 $buffer = $product_id . 476 ';"purchase";' . 477 $user_id . ';' . 478 round($item_price, 2). ';' . 479 round($item_quantity) . ';' . 480 '"' . $order->get_date_created()->format(DateTime::ATOM) . '"' . "\n"; 481 482 // Write to file 483 fwrite($fp, $buffer); 484 485 } 486 437 $fp = fopen($file, 'a'); // Open in append mode 438 439 // Write header only if the file is empty 440 if (filesize($file) === 0) { 441 $interactions_columns = "item_id;action;user_id;price;quantity;timestamp\n"; 442 fwrite($fp, $interactions_columns); 443 } 444 445 // Page marker file 446 $page_marker_file = plugin_dir_path(__FILE__) . 'interactions_page_marker_' . $options['private_token'] . '.txt'; 447 $start_page = 0; 448 449 // Load page marker if it exists 450 if (file_exists($page_marker_file)) { 451 $start_page = (int)file_get_contents($page_marker_file); 452 } 453 454 $one_day = 24 * 60 * 60; 455 $today = strtotime(date('Y-m-d')); 456 457 for ($i = $start_page; $i < 356 * 10; $i++) { 458 $start = 356 * 10 - $i; 459 460 // Fetch orders for the specific day 461 $query = new WC_Order_Query(array( 462 'limit' => -1, 463 'date_created' => ($today - ($start * $one_day)) . '...' . ($today - ($start * $one_day) + $one_day), 464 )); 465 $orders = $query->get_orders(); 466 467 error_log('Visidea - cron_interactions_dump processing day # ' . $i . ' with orders: ' . count($orders)); // Log progress 468 469 foreach ($orders as $order) { 470 // Get customer ID 471 $user_id = $order->get_user_id(); 472 473 foreach ($order->get_items() as $item_id => $item) { 474 // Get product 475 $product = $item->get_product(); 476 477 $product_id = is_object($product) ? $product->get_id() : 0; 478 $item_price = $item->get_total(); // Total price 479 $item_quantity = $item->get_quantity(); // Quantity 480 481 if ($product_id > 0 && !empty($user_id)) { 482 $buffer = $product_id . 483 ';"purchase";' . 484 $user_id . ';' . 485 round($item_price, 2) . ';' . 486 round($item_quantity) . ';' . 487 '"' . $order->get_date_created()->format(DateTime::ATOM) . '"' . "\n"; 488 489 fwrite($fp, $buffer); 490 } 491 } 487 492 } 488 489 } 490 493 494 // Save progress and log memory usage 495 file_put_contents($page_marker_file, $i); 496 error_log('Visidea - cron_interactions_dump saved page # ' . $i); 497 error_log('Visidea - cron_interactions_dump memory usage: ' . memory_get_usage(true)); 491 498 } 492 499 493 500 fclose($fp); 494 501 495 $old_filename = 'interactions_'.$options['private_token'].'.csv'; 496 $hash_filename = 'interactions_'.$options['private_token'].'.hash'; 497 unlink(plugin_dir_path(__FILE__) . $old_filename); 498 $file = plugin_dir_path(__FILE__) . $option_filename; 499 rename(plugin_dir_path(__FILE__) . $option_filename, plugin_dir_path(__FILE__) . $old_filename); 500 file_put_contents(plugin_dir_path(__FILE__) . $hash_filename, hash_file('md5', plugin_dir_path(__FILE__) . $old_filename)); 501 502 } 502 // Rename and hash the completed file 503 $old_filename = 'interactions_' . $options['private_token'] . '.csv'; 504 $hash_filename = 'interactions_' . $options['private_token'] . '.hash'; 505 if (file_exists(plugin_dir_path(__FILE__) . $old_filename)) { 506 unlink(plugin_dir_path(__FILE__) . $old_filename); 507 } 508 rename($file, plugin_dir_path(__FILE__) . $old_filename); 509 file_put_contents(plugin_dir_path(__FILE__) . $hash_filename, hash_file('sha256', plugin_dir_path(__FILE__) . $old_filename)); 510 511 // Cleanup page marker 512 unlink($page_marker_file); 513 514 error_log('Visidea - cron_interactions_dump job finished at ' . date(DATE_RFC2822)); // Log end 515 } 516 503 517 504 518 function check_crons() { -
visidea/trunk/readme.txt
r3224275 r3240028 6 6 Tested up to: 6.6 7 7 Requires PHP: 7.0 8 Stable tag: 2.1.1 38 Stable tag: 2.1.14 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 96 96 97 97 == Changelog == 98 99 = 2.1.14 2025-02-13 = 100 Changed the hashing algorithm to sha256 98 101 99 102 = 2.1.13 2025-01-17 = -
visidea/trunk/visidea.php
r3224275 r3240028 5 5 * Plugin URI: https://visidea.ai 6 6 * Description: Visidea is the search and recommendations plugin for WooCommerce. Visidea improves UX and increases the revenues of your website. 7 * Version: 2.1.1 37 * Version: 2.1.14 8 8 * Author: Inferendo 9 9 * Author URI: https://visidea.ai … … 27 27 * Current Visidea version. 28 28 */ 29 define('VISIDEA_VERSION', '2.1.1 3');29 define('VISIDEA_VERSION', '2.1.14'); 30 30 31 31 /**
Note: See TracChangeset
for help on using the changeset viewer.