Prevent mass deletion of votes based on IP search
Fixes
SIAProjectVotingAdmin::display_bulkActions()Bust Sitemap cache when replacing the home page
Fixes
SIA_Publishing_Sitemap::__bust_cache() from both SIAProjectVoting::restore_front_page() and SIAProjectVoting::take_over_front_page()Allow un-suspension with one ready Venture and all other checklist items true
New
SIAProjectVoting::get_competition_readiness() that includes the Competition instance’s readiness, plus the total projectsSIAProjectVoting::voting_can_be_manually_enabled() evaluation to return TRUE when all checklist items are evaluated TRUE, regardless of overall readiness statusvoting_can_be_manually_changed() to use voting_can_be_manually_enabled() for un-suspension, and return TRUE when voting is active for suspension, with the network value as the first guard clausePass phase state from network settings, lighter network reports
Otherwise, phase state to reports only triggers when status changes automatically or locally. Phase state can now also be sent via WP CLI by doing the ‘sia_project_voting_status_change’ action
New
SIAProjectVotingAdmin::display_mainPage() always shows the status in network reportsvoting_opening_time_can_be_changed()SIAProjectVoting::post_community_voting_status() passes along countrySlug arg$args, detect status in post_community_voting_status() to allow manual sending via wp eval "do_action( 'sia_project_voting_status_change', 'phase_state', [] );"validate_settings()update_blog_options triggered from process_networkSettings()Settings exeptions for Staging
SIAProjectVoting::STAGING_BLOG_ID constantSIAProjectVoting::$is_staging using Arielis_staging in spv_is_country_admin()CLI command for sending archival projects to remote
When called with an edition and an operation (e.g. ‘create’), look through mapped years to blog ids and send each one. Sent editions are stored in a site variable.
New
cv send-archival-edition-venture-data with required operation and edition, and optional silence and letsgo parameters in SIA_ProjectVoting_WP_CLI::post_competition_archival_edition_venture_data_to_remote()CLI command for sending archival summaries to remote
When called with an edition, look through mapped days and send the next one. Sent days are stored in a site option, same as edition projects sent.
New
cv send-edition-daily-summaries with required edition, and optional silence and letsgo parameters in SIA_ProjectVoting_WP_CLI::post_competition_archival_daily_summaries_to_remote()SIA_ProjectVoting::POSTED_DAILY_SUMMARIES_OPTION_ID stores the sent dates of daily summmariesSIA_ProjectVoting::POSTED_EDITIONS_OPTION_ID stores the editions whose projects were sent to the remoteSend a daily summary to remove when calling the CLI command
Fetch all votes between the day’s start and end timestamps, group them by project, and post them to the remote.
New
cv send-daily-summary with profiling, required MySQL date, and optional silence and letsgo parameters in SIA_ProjectVoting_WP_CLI::post_competition_daily_summary_to_remote()SIA_ProjectVoting::get_votesBatchForPeriod() to get raw vote data between 2 timestampsFixes
'year' instead of the correct 'edition' in SIA_ProjectVoting_WP_CLI::post_competition_venture_status_to_remote()Send a batch of 20 votes to remote when calling the CLI command
It will only send votes in the current year, and is designed for crontab. It sets a site option with the timestamp of the last sent vote and next time starts after the timestamp (unless rewind is used).
New
cv send-votes with profiling and optional silence, letsgo, and rewind parameters in `SIA_ProjectVoting_WP_CLI::post_current_competition_votes_to_remote()``SIA_ProjectVoting::get_votesBatch() to get raw vote data with no filtersSIA_ProjectVoting::BATCH_LAST_TIMESTAMP_OPTION_ID stores the name of the sitemeta variableImprovements
users table unless needed for a search in counting methods of SPVHelpers: get_votesCountByDay(), get_topCountries(), get_totalGroupedVotes(), and get_totalVotes()Send Venture post updates to the remote abstract, also via mass CLI command
When the post update or delete actions are triggered for a project (Venture), pick up the params and send them further to the Ariel remote abstract for posting to Airtable.
To quickly send 2024 projects, add a CLI method to post venture data to remote for an entire Competition.
New
SIAProjectVoting::post_venture_status_to_remote() hooked to save_post_project with priority 11, after the meta saving methodSIAProjectVoting::post_venture_removal_to_remote() hooked to after_delete_post with priority 11send-venture-data WP CLI method to mass send archival (and as of right now current) projects to the ComVo remote with 3 possible operations: create, update, delete (not working without both a site and a project id, so not mass) SIA_ProjectVoting_WP_CLI::post_competition_venture_status_to_remote()Improvements
phase_import_finished action after SIAProjectVotingAdmin::import_ventures_from_inka() finishes and hook into it for the first creation of projectsSend voting phase updates to the remote abstract
When the phase update action is triggered, pick up the params and send them further to the Ariel remote abstract for posting to Airtable.
New
SIAProjectVoting::post_community_voting_status() hooked to sia_project_voting_status_change with priority 11, after the Simple History loggerImprovements
SIAProjectVotingLogger::action__status_change() checking for data integrityCorrectly identify when voting takes place
Base it on the licensing pipeline status exclusively. Refine and separate the archival and reset process.
New
SIA_Ariel::is_team_blog()) excluding INT, then for a licensee transient to decide whether a competition should take place in SIAProjectVoting::voting_is_not_taking_place(), removing the flawed check for existing optionsSIAProjectVotingAdmin::process_networkSettings() in the $_POST['archive_edition'] case by calling specialized methodsSIAProjectVotingAdmin::archive_edition()SIAProjectVotingAdmin::reset_network_to_defaults() that also calls SIAProjectVotingAdmin::reset_all_blogs_options()update_all_blogs_options to reflect it’s only usage (resetting settings) and refactor to empty each blog’s spv_options from SIAProjectVotingAdmin::reset_all_blogs_options()Improvements
SIAProjectVoting::voting_is_not_taking_place()SIA_ProjectVoting_WP_CLI::get_competition_settings() to list countries regardless of taking place or nottaking_place_adjusted with a count of local options to identify discrepanciesVOTING_IS_NOT_PREPARED) in the toggle-competition-status stop commandEnhance the not taking place method and add a reset CLI command
To clean up this year’s erroneous editions and improve developemnt, add a WP CLI command to reset() a competition. It does validate against the environment.
To prevent future “activations” of ComVo, tentatively improve the not taking place switch.
Because there’s a relatively high level on one IP, provide a report to blogs.
New
wp cv reset with mandatory --site blog ID param and a --force param that only works in dev and ignores imported Ventures or existing votesspv_options blog option, flushes its cache, and reloads it in SIA_Competition::reset()Improvements
notab from SIAProjectVotingAdmin::$pages['ips']FALSE parameter in SIAProjectVoting::voting_is_not_taking_place()Update translations to include the webview warnings
Improve webview Google registration warning
Try to make it more noticeable for users by filtering the default message coming from Modal Log in / Register and rephrasing to mention voting.
Improvements
webview_warning message showin in embedded browsers from SIAProjectVoting::mlr_l10params() hooked to mlr_l10params from SIAProjectVoting::__construct()SIAProjectVoting::$defaultOptions to improve readibilityAdd a setting value filter to the Competition settings CLI command
To find the ‘test_mode’ settings faster, filter the output of the get-competition-settings command by a setting name and value
Improvements
--filter argument to wp cv get-competition-settings --filter=test_mode,1 to limit the number the resultsget-competition-settings tableWP CLI commands for listing settings and updating a setting
In order to “repair” left over Test modes after competitions were manually enabled, a new WP CLI command (update-competition-setting) now validates and updates a single setting.
To find all sites that are either in the unknown or have erroneous settings, a new WP CLI command (get-competition-settings) lists Project Voting settings for a single blog or for all.
New
wp cv get-competition-settings with optional --site blog ID paramwp cv update-competition-setting with mandatory setting and value parmas and --site blog ID paramFixes
global.js::init_selectedProjects(), where it was checking for the help cookie and then triggering the in~s~tructions buttonWP CLI commands for toggling Competition status and busting its cache
Add the 2 cache busting and status togglers to WP CLI to simplify support; Improve performance by removing some total votes counts; Add a local option as a switch checking if turning on or off was processed for a year.
New
wp cv toggle-competition-status start with mandatory --site blog ID paramwp cv bust-competition-cache with mandatory --site blog ID paramvoting_is_manually_suspended in SIAProjectVotingAdmin::disable_votingManually() and SIAProjectVotingAdmin::enable_votingManually()$plugin as a parameter to SIAProjectVotingAdmin::__construct() in order to not reuse the get_instance() provided before switching blogs from CLIspv_automatic_disabling_processed_for_{year} was set when checking if SIAProjectVoting::voting_should_be_disabled_automatically(), set when running SIAProjectVoting::turn_voting_on_or_off_automatically()spv_automatic_enabling_processed_for_{year} was set when checking if SIAProjectVoting::voting_should_be_enabled_automatically(), set when running SIAProjectVoting::turn_voting_on_or_off_automatically()Improvements
SIAProjectVotingAdmin::register_dashboard_widget()SIAProjectVotingAdmin::__construct()template-dashboard-widget.phpFixes
test_mode) enabled when using SIAProjectVoting::disable_votingAutomatically() and SIAProjectVoting::suspend_voting_automatically()test_mode) enabled with SIAProjectVotingAdmin::disable_votingManually() and SIAProjectVotingAdmin::enable_votingManually()Update Armenian (hy) and Hungarian (hu) translations
Show a percentage of ready Ventures
When the number is above 0 and there are imported ventures, show a percentage. It massively simplifies understading the network dashboard.
New
bool in the checklist of SIA_Competition::evaluate_readiness_for_voting()SPV_Template::get_checklist()Improved messaging on the modal verification pop-up
Replace the title and intro and add a mention to the privacy policy. Specify that it’s not about registration, but about continuing a verification with a social network.
So “register” is “Almost there” and the text explains it’s about verification, not registration. Plus there’s a link to the privacy policy. And the buttons say “Continue with…”
Also, reduce the impact of the provider alter to only outside of the wp-login.php page.
New
mmlr_modal_text via SIAProjectVoting::mmlr_modal_text()wsl_render_auth_widget_alter_provider_name with wsl_render_auth_widget_alter_provider_name::wsl_provider_name() on priority 10mmlr_wls_action_params callback in SIAProjectVoting::__construct()wp-login.php“ in SIAProjectVoting::mmlr_wls_action_params() hooked to mmlr_wls_action_paramsBump to major after close
It’s mostly fixes documented in CHANGELOG.md ## 20.53.0
Fixes
SIAProjectVoting::enqueue_javascriptAndCSS()Bring the Community Voting script to the new landing page
Fixes
spv_is_voting_page() Remove all admin translation suggestions and update POs
Start adapting to Wanda
Look for layout post meta, not template; Exclude transients for current competition; Improve cache busting
New
SIA_Competition::__bust_cache()SIAProjectVoting::LAYOUT_SLUG constant in the new SIAProjectVoting::getCommunityVotingPageId() get_pageID() with the specific SIAProjectVoting::getCommunityVotingPageId() everywhereFixes
SIA_Competition::__construct()SIA_Competition::load_instance()SIA_Competition::load_instance()template-status-check.phpSIAProjectVotingAdmin::bust_transients()Fix SIA Competition transients usage
After updating Community Voting settings, the transients would stubbornly show previous details.
Fixes
SIAProjectsAdmin::validate_settings() (single blog) and SIAProjectsAdmin::process_networkSettings()Improve loading of competition data from the database
Store Competition objects first in a static variable, keyed by blog id and year, and in transients
New
static and in transients from the new SIA_Competition::load_instance() that first looks for the static $sia_competition_load_instance and then for a transient using SIA_Ariel_Transient_Serviceload_instance() in SPVHelpers::get_countryInfo()SPVHelpers::get_totalVotes(), except for search results which would lead either to slow transient name generation via md5() or too long transient names that don’t fit the DB table structureSIAProjectVoting::get_years() by adding a new blogIds property that stores an array of blog Ids that have a return from SIAProjectVoting::years()class-competition.php class to the more fitting class-sia-competition.phpREADME with the first written version to the changelogFixes