Skip to content

Major Update#176

Open
jkrrv wants to merge 409 commits intomasterfrom
next
Open

Major Update#176
jkrrv wants to merge 409 commits intomasterfrom
next

Conversation

@jkrrv
Copy link
Copy Markdown
Member

@jkrrv jkrrv commented Feb 11, 2024

No description provided.

jkrrv added 29 commits July 23, 2024 22:01
… Makes more complicated schedules a lot easier to read. Closes #194.
Copilot AI review requested due to automatic review settings April 9, 2026 02:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR modernizes and expands the TouchPoint-WP plugin by refactoring core interfaces/APIs, adding admin/dashboard and block-editor features, and improving data syncing (reports/meetings/partners) while bumping the project version to 0.0.97.

Changes:

  • Refactors API/auth/error handling (new Api class, updated interfaces/namespaces, improved exception/WP_Error integration).
  • Adds new features: dashboard Status widget, telemetry Stats submission, block editor blocks + block preview styling, calendar grid styling.
  • Enhances syncing and display for Reports/Partners/Meetings (new endpoints, caching, updated rendering, rewrite/maintenance endpoints).

Reviewed changes

Copilot reviewed 59 out of 117 changed files in this pull request and generated 34 comments.

Show a summary per file
File Description
src/TouchPoint-WP/TouchPointWP_Exception.php Extends exception handling, admin error display, adds toWpError()
src/TouchPoint-WP/TouchPointWP_AdminAPI.php Adds admin API endpoints (divisions, involvement search), migration/flush/phpinfo endpoints
src/TouchPoint-WP/StatusWidget.php Adds admin dashboard status widget for synced object counts/timestamps
src/TouchPoint-WP/Stats.php Adds telemetry/statistics collection, persistence, and submission endpoints
src/TouchPoint-WP/Rsvp.php Adds deprecation notes and TODOs around RSVP/Meeting consolidation
src/TouchPoint-WP/Report.php Expands reporting (python + assets), caching/cleanup, post storage interface, inline rendering
src/TouchPoint-WP/RegistrationType.php Adds registration type constants (future enum)
src/TouchPoint-WP/PostTypeCapable.php Adds base class for post-backed domain objects
src/TouchPoint-WP/Partner.php Refactors Partner to post-backed model; improves taxonomy handling, templates, map/filter JS integration
src/TouchPoint-WP/MeetingArray.php Adds grouped meeting collection type implementing meeting API interface
src/TouchPoint-WP/Lookup.php Adds cached lookup endpoint wrapper via WordPress transients
src/TouchPoint-WP/Location.php Moves geo interface usage to hasGeo, adds helpers and Geo distance usage
src/TouchPoint-WP/Involvement_PostTypeSettings.php Adds meeting/import settings, filter hooks, and helper methods
src/TouchPoint-WP/Interfaces/updatesViaCron.php Moves interface into Interfaces namespace + typed methods
src/TouchPoint-WP/Interfaces/storedAsPost.php Adds interface for post-backed modules
src/TouchPoint-WP/Interfaces/scheduled.php Adds interface for schedule string generation
src/TouchPoint-WP/Interfaces/module.php Moves interface, adds template overwrite constants
src/TouchPoint-WP/Interfaces/involvementMeetingCommon.php Adds shared interface for involvement/meeting capabilities
src/TouchPoint-WP/Interfaces/hierarchical.php Adds interface for parent/child relationships
src/TouchPoint-WP/Interfaces/hasGeo.php Renames geo interface & standardizes Geo return type
src/TouchPoint-WP/Interfaces/apiMeeting.php Adds interface for meeting(-like) API payloads
src/TouchPoint-WP/Interfaces/api.php Moves API handler interface and clarifies semantics
src/TouchPoint-WP/Interfaces/actionButtons.php Adds interface for standardized action button rendering
src/TouchPoint-WP/Geo.php Moves/expands Geo into core namespace with standardized fields
src/TouchPoint-WP/ExtraValueHandler.php Updates documentation/comments for EV handling
src/TouchPoint-WP/EventsCalendar.php Deprecates legacy events calendar integration; adds meetings-based path
src/TouchPoint-WP/CalendarGrid.php Adds calendar grid renderer and style enqueueing
src/TouchPoint-WP/Blocks/BlocksController.php Registers/enqueues block assets via blocks manifest + provides editor CSS endpoint
src/TouchPoint-WP/Auth.php Refactors auth flow (one-time login validation) and admin/profile redirect behavior
src/TouchPoint-WP/Api.php Adds centralized TouchPoint API client (PAT + python endpoints, rate limiting, PAT cycling)
phpdoc.dist.xml Updates phpDocumentor configuration and output settings
package.json Bumps version and adds WordPress block build tooling deps/scripts
generateI18n_2forPublish.ps1 Adds make-php i18n generation
generateI18n_1forTranslation.ps1 Updates WP-CLI args ordering for POT generation
generateDocs.ps1 Removes old PowerShell phpDocumentor generator
generateDocs.php Adds PHP-based doc generation pipeline and hook/docs publishing
docs Updates docs submodule pointer
composer.json Bumps version, raises PHP requirement, adds Interfaces autoload + docs dev deps
buildPipeline/versionUpdate.js Adds script to sync version across composer/package/blocks assets
build.sh Adds npm install/build blocks/version sync + build timing output
blocks/people-list/index.js Adds People List block with live preview + inspector controls
blocks/people-list/block.json Adds block metadata for People List
blocks/inv-list/index.js Adds Involvement List block with live preview + filtering
blocks/inv-list/block.json Adds block metadata for Involvement List
blocks/common.js Adds shared unique-id generator for blocks
assets/template/partials-template-style.css Updates list/map/action button styles and adds marker highlight animation
assets/template/calendar-grid-style.css Adds calendar grid styling
assets/template/block-preview-style.css Adds block preview overlay styling for editor
assets/template/actions-style.css Adds icon mask styles for inline icons
assets/js/partner-defer.js Refactors Partner JS into tpvm namespace + updates marker/map behavior
assets/js/meeting-defer.js Updates Meeting JS to use tpvm.* classes and adds RSVP button disabling on missing meetings
assets/js/base-defer.js Refactors base JS into IIFE + updates map markers to AdvancedMarker/Pins and hover/action wiring
README.md Updates docs for new features (event calendar, embedded reports, telemetry note) and re-labels deprecated sections
.github/workflows/releases.yml Adds docs generation job and adjusts release workflow structure
.github/workflows/push.yml Adds CI build workflow on branch pushes
Files not reviewed (13)
  • .idea/.gitignore: Language not supported
  • .idea/TouchPoint-WP.iml: Language not supported
  • .idea/inspectionProfiles/Project_Default.xml: Language not supported
  • .idea/libraries/Generated_files.xml: Language not supported
  • .idea/misc.xml: Language not supported
  • .idea/php.xml: Language not supported
  • .idea/phpunit.xml: Language not supported
  • .idea/runConfigurations/Build__WSL_.xml: Language not supported
  • .idea/runConfigurations/i18n__1_for_Translation.xml: Language not supported
  • .idea/runConfigurations/i18n__2_for_Publish.xml: Language not supported
  • .idea/sqldialects.xml: Language not supported
  • .idea/vcs.xml: Language not supported
  • .idea/watcherTasks.xml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jkrrv and others added 2 commits April 8, 2026 22:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jkrrv jkrrv requested a review from Copilot April 9, 2026 03:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 59 out of 117 changed files in this pull request and generated 9 comments.

Files not reviewed (13)
  • .idea/.gitignore: Language not supported
  • .idea/TouchPoint-WP.iml: Language not supported
  • .idea/inspectionProfiles/Project_Default.xml: Language not supported
  • .idea/libraries/Generated_files.xml: Language not supported
  • .idea/misc.xml: Language not supported
  • .idea/php.xml: Language not supported
  • .idea/phpunit.xml: Language not supported
  • .idea/runConfigurations/Build__WSL_.xml: Language not supported
  • .idea/runConfigurations/i18n__1_for_Translation.xml: Language not supported
  • .idea/runConfigurations/i18n__2_for_Publish.xml: Language not supported
  • .idea/sqldialects.xml: Language not supported
  • .idea/vcs.xml: Language not supported
  • .idea/watcherTasks.xml: Language not supported
Comments suppressed due to low confidence (1)

src/TouchPoint-WP/Taxonomies.php:1

  • $types is an array, but it is compared directly to an integer ($types > 0). This can produce incorrect behavior or runtime warnings/errors depending on PHP version/config. Use count($types) > 0 (consistent with the rest of the file).
<?php

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +546 to +553
// Delete terms that are no longer used
if (TouchPointWP::instance()->settings->global_primary_tax !== "") {
$terms = get_terms(
['taxonomy' => Taxonomies::TAX_GP_CATEGORY, 'hide_empty' => false, 'exclude' => $termsToKeep]
);
if (!is_wp_error($terms)) {
foreach ($terms as $term) {
wp_delete_term($term->term_id, Taxonomies::TAX_GP_CATEGORY);
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If $termsToKeep is empty (e.g., category EV not configured, no categories returned, or term creation failed), this deletes all terms in the taxonomy, including ones that may still be assigned to posts. Consider scoping deletion to unused terms only (e.g., hide_empty => true + delete those), and/or only running this cleanup when the category EV is configured and a non-empty keep set is known to be complete.

Suggested change
// Delete terms that are no longer used
if (TouchPointWP::instance()->settings->global_primary_tax !== "") {
$terms = get_terms(
['taxonomy' => Taxonomies::TAX_GP_CATEGORY, 'hide_empty' => false, 'exclude' => $termsToKeep]
);
if (!is_wp_error($terms)) {
foreach ($terms as $term) {
wp_delete_term($term->term_id, Taxonomies::TAX_GP_CATEGORY);
// Delete terms that are no longer used.
// Only run this cleanup when the category setting is configured and we have
// a non-empty authoritative keep set from the current sync.
if (TouchPointWP::instance()->settings->global_primary_tax !== "" && !empty($termsToKeep)) {
$terms = get_terms(
['taxonomy' => Taxonomies::TAX_GP_CATEGORY, 'hide_empty' => false, 'exclude' => $termsToKeep]
);
if (!is_wp_error($terms)) {
foreach ($terms as $term) {
// Preserve any terms that are still assigned to posts.
if ((int) $term->count === 0) {
wp_delete_term($term->term_id, Taxonomies::TAX_GP_CATEGORY);
}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I disagree. If there is no field configured for use as this taxonomy, it should delete the terms and remove them from the posts. That said, if there is one configured, I do see the value in validating that the list is not empty.

@jkrrv jkrrv requested a review from Copilot April 9, 2026 03:43
@jkrrv jkrrv changed the title Bugfixes Major Update Apr 9, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 59 out of 117 changed files in this pull request and generated 4 comments.

Files not reviewed (13)
  • .idea/.gitignore: Language not supported
  • .idea/TouchPoint-WP.iml: Language not supported
  • .idea/inspectionProfiles/Project_Default.xml: Language not supported
  • .idea/libraries/Generated_files.xml: Language not supported
  • .idea/misc.xml: Language not supported
  • .idea/php.xml: Language not supported
  • .idea/phpunit.xml: Language not supported
  • .idea/runConfigurations/Build__WSL_.xml: Language not supported
  • .idea/runConfigurations/i18n__1_for_Translation.xml: Language not supported
  • .idea/runConfigurations/i18n__2_for_Publish.xml: Language not supported
  • .idea/sqldialects.xml: Language not supported
  • .idea/vcs.xml: Language not supported
  • .idea/watcherTasks.xml: Language not supported
Comments suppressed due to low confidence (1)

src/TouchPoint-WP/Report.php:1

  • If the SQL report output doesn’t contain </tr> or <tr, strrpos() returns false and the substr offsets will be wrong, producing corrupted output (or warnings depending on PHP settings). Guard for missing markers (return original content, or apply cleanup only when both markers are found).
<?php

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +491 to +495
// upsert the data into the database into the stats table without destructive replace function
global $wpdb;
$r = $wpdb->update($wpdb->prefix . TouchPointWP::TABLE_STATS, $data, ['installId' => $data['installId']]);
if ($r < 1) {
$r = $wpdb->insert($wpdb->prefix . TouchPointWP::TABLE_STATS, $data);
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$wpdb->update() returns 0 when the row exists but no fields changed, which makes this code attempt an insert and can create duplicates / fail on unique constraints. Treat 0 as success when a row exists (e.g., check for existence first) or use a true upsert pattern (single SQL INSERT ... ON DUPLICATE KEY UPDATE ...) to avoid duplicate insert attempts.

Suggested change
// upsert the data into the database into the stats table without destructive replace function
global $wpdb;
$r = $wpdb->update($wpdb->prefix . TouchPointWP::TABLE_STATS, $data, ['installId' => $data['installId']]);
if ($r < 1) {
$r = $wpdb->insert($wpdb->prefix . TouchPointWP::TABLE_STATS, $data);
// Upsert the data into the stats table without treating a no-op update as a failed write.
global $wpdb;
$table = $wpdb->prefix . TouchPointWP::TABLE_STATS;
$existingInstallId = $wpdb->get_var($wpdb->prepare(
"SELECT installId FROM {$table} WHERE installId = %s LIMIT 1",
$data['installId']
));
if ($existingInstallId !== null) {
$r = $wpdb->update($table, $data, ['installId' => $data['installId']]);
} else {
$r = $wpdb->insert($table, $data);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants