Project Voting Changelog

Changelog

13.3.0

Prevent mass deletion of votes based on IP search

Fixes

  • Unset the ‘delete’ Bulk Action in the users report when the search string is an IP and the user is not a super-admin by adding a guard clause in SIAProjectVotingAdmin::display_bulkActions()

13.2.1

Bust Sitemap cache when replacing the home page

Fixes

  • Call SIA_Publishing_Sitemap::__bust_cache() from both SIAProjectVoting::restore_front_page() and SIAProjectVoting::take_over_front_page()

13.2.0

Allow un-suspension with one ready Venture and all other checklist items true

New

  • New SIAProjectVoting::get_competition_readiness() that includes the Competition instance’s readiness, plus the total projects
  • Refactor SIAProjectVoting::voting_can_be_manually_enabled() evaluation to return TRUE when all checklist items are evaluated TRUE, regardless of overall readiness status
  • Refactor voting_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 clause

13.1.0

Pass 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 reports
  • Allow changing time settings in dev from voting_opening_time_can_be_changed()
  • SIAProjectVoting::post_community_voting_status() passes along countrySlug arg
  • When not present in $args, detect status in post_community_voting_status() to allow manual sending via wp eval "do_action( 'sia_project_voting_status_change', 'phase_state', [] );"
  • Send local phase state from validate_settings()
  • Send every phase state from update_blog_options triggered from process_networkSettings()

13.0.0

Settings exeptions for Staging

  • SIAProjectVoting::STAGING_BLOG_ID constant
  • New SIAProjectVoting::$is_staging using Ariel
  • Include is_staging in spv_is_country_admin()

12.15.0

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

  • New CLI command 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()

12.14.0

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

  • New CLI command 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()
  • New constant SIA_ProjectVoting::POSTED_DAILY_SUMMARIES_OPTION_ID stores the sent dates of daily summmaries
  • New constant SIA_ProjectVoting::POSTED_EDITIONS_OPTION_ID stores the editions whose projects were sent to the remote

12.13.0

Send 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

  • New CLI command 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()
  • New as fast as possible static function SIA_ProjectVoting::get_votesBatchForPeriod() to get raw vote data between 2 timestamps

Fixes

  • Fix incorrect named parameter when sending project updates by edition, looking for 'year' instead of the correct 'edition' in SIA_ProjectVoting_WP_CLI::post_competition_venture_status_to_remote()

12.12.0

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

  • New CLI command cv send-votes with profiling and optional silence, letsgo, and rewind parameters in `SIA_ProjectVoting_WP_CLI::post_current_competition_votes_to_remote()``
  • New as fast as possible static function SIA_ProjectVoting::get_votesBatch() to get raw vote data with no filters
  • New constant SIA_ProjectVoting::BATCH_LAST_TIMESTAMP_OPTION_ID stores the name of the sitemeta variable

Improvements

  • Try to speed up some queries by removing joins with the users table unless needed for a search in counting methods of SPVHelpers: get_votesCountByDay(), get_topCountries(), get_totalGroupedVotes(), and get_totalVotes()

12.11.0

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

  • Send the project create and update updates to the Airtable ComVo reports from SIAProjectVoting::post_venture_status_to_remote() hooked to save_post_project with priority 11, after the meta saving method
  • Send the project deleted updates to the Airtable ComVo reports from SIAProjectVoting::post_venture_removal_to_remote() hooked to after_delete_post with priority 11
  • Add the send-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

  • Make a 2025 mention to add a new phase_import_finished action after SIAProjectVotingAdmin::import_ventures_from_inka() finishes and hook into it for the first creation of projects

12.10.0

Send 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

  • Send the status update to the Airtable ComVo reports via the Ariel remote abstract from SIAProjectVoting::post_community_voting_status() hooked to sia_project_voting_status_change with priority 11, after the Simple History logger

Improvements

  • To prevent recording logging debug actions, add a couple switches to SIAProjectVotingLogger::action__status_change() checking for data integrity

12.9.0

Correctly identify when voting takes place

Base it on the licensing pipeline status exclusively. Refine and separate the archival and reset process.

New

  • Check first for a team blog (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 options
  • Separate archival of network settings from reset of settings and reset of blog settings in SIAProjectVotingAdmin::process_networkSettings() in the $_POST['archive_edition'] case by calling specialized methods
  • Add a method to archive the current edition in SIAProjectVotingAdmin::archive_edition()
  • Add a method to reset the current edition in SIAProjectVotingAdmin::reset_network_to_defaults() that also calls SIAProjectVotingAdmin::reset_all_blogs_options()
  • Rename 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

  • Check for team blog in ‘not taking place’, otherwise Play is maintained and apparently should run, in SIAProjectVoting::voting_is_not_taking_place()
  • Add an ‘all’ filter to the settings list CLI command in SIA_ProjectVoting_WP_CLI::get_competition_settings() to list countries regardless of taking place or not
  • Clean up the output where there are no options, and replace taking_place_adjusted with a count of local options to identify discrepancies
  • Include the 404 status (VOTING_IS_NOT_PREPARED) in the toggle-competition-status stop command

12.8.0

Enhance 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 CLI command to reset a competition’s settings: wp cv reset with mandatory --site blog ID param and a --force param that only works in dev and ignores imported Ventures or existing votes
  • Add a reset method to Competition that empties the spv_options blog option, flushes its cache, and reloads it in SIA_Competition::reset()

Improvements

  • Restore the IP report on team blogs by removing notab from SIAProjectVotingAdmin::$pages['ips']
  • Enhance the check for not taking place by including blog maintainer, for now optionally as a default FALSE parameter in SIAProjectVoting::voting_is_not_taking_place()

12.7.0

Update translations to include the webview warnings


12.6.0

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

  • Rephrase the webview_warning message showin in embedded browsers from SIAProjectVoting::mlr_l10params() hooked to mlr_l10params from SIAProjectVoting::__construct()
  • Alphabetize the default options in SIAProjectVoting::$defaultOptions to improve readibility

12.5.0

Add 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

  • Add the --filter argument to wp cv get-competition-settings --filter=test_mode,1 to limit the number the results
  • Display the blog id in the get-competition-settings table

12.4.0

WP 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 CLI command to update a competition setting: wp cv get-competition-settings with optional --site blog ID param
  • WP CLI command to update a competition setting: wp cv update-competition-setting with mandatory setting and value parmas and --site blog ID param

Fixes

  • Correct typo in the help cookie setting checker in global.js::init_selectedProjects(), where it was checking for the help cookie and then triggering the in~s~tructions button

12.3.0

WP 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 CLI command to toggle the status of the competition: wp cv toggle-competition-status start with mandatory --site blog ID param
  • WP CLI command to bust the cache of the competition: wp cv bust-competition-cache with mandatory --site blog ID param
  • Check if CLI is running the methods and if yes, toggle voting_is_manually_suspended in SIAProjectVotingAdmin::disable_votingManually() and SIAProjectVotingAdmin::enable_votingManually()
  • Provide a $plugin as a parameter to SIAProjectVotingAdmin::__construct() in order to not reuse the get_instance() provided before switching blogs from CLI
  • Add a local option as a switch checking if spv_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()
  • Add a local option as a switch checking if 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

  • Improve performance by stoping showing a dashboard widget in network reports from SIAProjectVotingAdmin::register_dashboard_widget()
  • Improve performance by not hooking the admin bar Community Voting item from SIAProjectVotingAdmin::__construct()
  • Improve performance by leaving global comparisons out of the team website dashboard widget from template-dashboard-widget.php

Fixes

  • Fix having left Test mode (test_mode) enabled when using SIAProjectVoting::disable_votingAutomatically() and SIAProjectVoting::suspend_voting_automatically()
  • Fix leaving Test mode (test_mode) enabled with SIAProjectVotingAdmin::disable_votingManually() and SIAProjectVotingAdmin::enable_votingManually()

12.2.0

Update Armenian (hy) and Hungarian (hu) translations


12.1.0

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

  • Return the number of ready ventures instead of a bool in the checklist of SIA_Competition::evaluate_readiness_for_voting()
  • Display the number and, by case, a percentage, in SPV_Template::get_checklist()

12.0.0

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

  • Change the verbiage in the modal pop-up by hooking into mmlr_modal_text via SIAProjectVoting::mmlr_modal_text()
  • Replace “register with” with “continue with” by hooking into wsl_render_auth_widget_alter_provider_name with wsl_render_auth_widget_alter_provider_name::wsl_provider_name() on priority 10
  • Specify the number of parameters for the mmlr_wls_action_params callback in SIAProjectVoting::__construct()
  • Reduce the scope of the callback activating WSL providers to “not on wp-login.php“ in SIAProjectVoting::mmlr_wls_action_params() hooked to mmlr_wls_action_params

11.0.0

Bump to major after close

It’s mostly fixes documented in CHANGELOG.md ## 20.53.0

Fixes

  • Fix error on attempt to use deprecated dependencies in SIAProjectVoting::enqueue_javascriptAndCSS()

10.28.0

Bring the Community Voting script to the new landing page

Fixes

  • Remove outdated script dependencies from `SIAProjectVoting::enqueue_javascriptAndCSS()``
  • Fix Community Voting page identification in spv_is_voting_page()

10.27.0

Remove all admin translation suggestions and update POs


10.26.0

Start adapting to Wanda

Look for layout post meta, not template; Exclude transients for current competition; Improve cache busting

New

  • Add a cache buster to Competition that takes over busting older transients (pre 2023) and also busts its own year’s transient in SIA_Competition::__bust_cache()
  • Start looking for the layout slug declared as the SIAProjectVoting::LAYOUT_SLUG constant in the new SIAProjectVoting::getCommunityVotingPageId()
  • Replace get_pageID() with the specific SIAProjectVoting::getCommunityVotingPageId() everywhere

Fixes

  • Fix incorrect status by ignored year in SIA_Competition::__construct()
  • Eliminate the current year when considering transients in SIA_Competition::load_instance()
  • Enforce blog switching then loading an instance in SIA_Competition::load_instance()
  • Introduce a venture import test-only period by not allowing the import before August 15 in template-status-check.php
  • Fix the stale transients by removing the status update check from SIAProjectVotingAdmin::bust_transients()

10.25.1

Fix SIA Competition transients usage

After updating Community Voting settings, the transients would stubbornly show previous details.

Fixes

  • Bust transients from both SIAProjectsAdmin::validate_settings() (single blog) and SIAProjectsAdmin::process_networkSettings()

10.25.0

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

  • Store competition data in 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_Service
  • Make use of the new load_instance() in SPVHelpers::get_countryInfo()
  • Start storing number of votes results into transients in 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 structure
  • Start storing blog ids in the output of SIAProjectVoting::get_years() by adding a new blogIds property that stores an array of blog Ids that have a return from SIAProjectVoting::years()
  • Rename the class-competition.php class to the more fitting class-sia-competition.php
  • Add this README with the first written version to the changelog

Fixes

  • More annotations of variable types