Skip to content

Conversation

@ilicfilip
Copy link
Collaborator

When pp-hosts (or other host plugins bundling Progress Planner) is updated, hooks registered by the old plugin version can fire during the update process. At that point, dependencies may not be available because files are being extracted, causing fatal errors like:

  • Call to a member function get_post_types_names() on null
  • Class "Progress_Planner\Activities\Maintenance" not found

This PR fixes that by adding checks and making early exits:

  • Add null check for get_activities__content_helpers() in Content class should_skip_saving() method
  • Add null checks in Content_Scan class get_total_pages() and update_stats() methods
  • Add class_exists() check in Maintenance class before instantiating Activities_Maintenance

@github-actions
Copy link
Contributor

Test on Playground
Test this pull request on the Playground
or download the zip

@github-actions
Copy link
Contributor

✅ Code Coverage Report

Metric Value
Total Coverage 31.61% 📉
Base Coverage 31.63%
Difference 📉 -0.02%

⚠️ Coverage below recommended 40% threshold

📊 File-level Coverage Changes (3 files)

📉 Coverage Decreased

Class Before After Change
Progress_Planner\Actions\Maintenance 33.33% 30.77% -2.56%
Progress_Planner\Actions\Content 91.92% 91.18% -0.74%
Progress_Planner\Actions\Content_Scan 3.57% 2.94% -0.63%
ℹ️ About this report
  • All tests run in a single job with Xdebug coverage
  • Security tests excluded from coverage to prevent output issues
  • Coverage calculated from line coverage percentages

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