68% post-expirator

Code Review | PublishPress Future: Automatically Unpublish WordPress Posts

WordPress plugin PublishPress Future: Automatically Unpublish WordPress Posts scored68%from 54 tests.

About plugin

  • Plugin page: post-expirator
  • Plugin version: 3.1.3
  • PHP compatiblity: 7.2.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4
  • WordPress version: 6.3.1
  • First release: Jul 31, 2008
  • Latest release: Nov 9, 2023
  • Number of updates: 308
  • Update frequency: every 18.1 days
  • Top authors: axelseaa (68.83%)andergmartins (20.78%)publishpress (7.14%)stevejburge (4.22%)

Code review

54 tests

User reviews

147 reviews

Install metrics

100,000+ active /2,176,265 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲3.22MB] [CPU: ▲31.80ms] Passed 4 tests

This is a short check of server-side resources used by PublishPress Future: Automatically Unpublish WordPress Posts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /6.65 ▲3.1872.35 ▲34.65
Dashboard /wp-admin6.57 ▲3.2684.85 ▲35.08
Posts /wp-admin/edit.php6.66 ▲3.3092.92 ▲44.62
Add New Post /wp-admin/post-new.php9.15 ▲3.26113.40 ▲21.95
Media Library /wp-admin/upload.php6.43 ▲3.2065.29 ▲35.52
Settings /wp-admin/admin.php?page=publishpress-future6.4862.13
Future Actions /wp-admin/admin.php?page=publishpress-future-scheduled-actions6.4366.73
Upgrade to Pro /wp-admin/admin.php?page=publishpress-future-menu-upgrade-link6.4057.89
Scheduled Actions /wp-admin/tools.php?page=action-scheduler6.4373.07

Server storage [IO: ▲2.99MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 316 new files
Database: 6 new tables, 19 new options
New tables
wp_actionscheduler_claims
wp_postexpirator_debug
wp_actionscheduler_actions
wp_ppfuture_actions_args
wp_actionscheduler_groups
wp_actionscheduler_logs
New WordPress options
expirationdateFooterStyle
action_scheduler_hybrid_store_demarkation
widget_recent-comments
expirationdateDefaultDate
can_compress_scripts
schema-ActionScheduler_StoreSchema
widget_theysaidso_widget
db_upgraded
post-expirator_wp_reviews_installed_on
expirationdateDebug
...

Browser metrics Passed 4 tests

Checking browser requirements for PublishPress Future: Automatically Unpublish WordPress Posts
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6514.32 ▲0.011.83 ▲0.1931.27 ▼13.11
Dashboard /wp-admin2,235 ▲585.70 ▲0.0886.20 ▼7.9141.23 ▼3.49
Posts /wp-admin/edit.php2,733 ▲6302.06 ▲0.0943.07 ▲4.6836.80 ▼0.61
Add New Post /wp-admin/post-new.php1,577 ▲5122.21 ▼1.24690.54 ▲63.7861.50 ▲13.05
Media Library /wp-admin/upload.php1,437 ▲344.20 ▼0.0299.35 ▼2.3645.10 ▲2.41
Settings /wp-admin/admin.php?page=publishpress-future1,2081.6822.8246.31
Future Actions /wp-admin/admin.php?page=publishpress-future-scheduled-actions1,2182.0628.5532.40
Upgrade to Pro /wp-admin/admin.php?page=publishpress-future-menu-upgrade-link2,4962.3243.7268.98
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,2851.8428.6536.33

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure failed, leaving 6 tables in the database
    • wp_ppfuture_actions_args
    • wp_actionscheduler_logs
    • wp_actionscheduler_claims
    • wp_postexpirator_debug
    • wp_actionscheduler_groups
    • wp_actionscheduler_actions
  • This plugin did not uninstall successfully, leaving 19 options in the database
    • schema-ActionScheduler_LoggerSchema
    • schema-ActionScheduler_StoreSchema
    • expirationdateDefaultDate
    • post-expirator_wp_reviews_installed_on
    • expirationdateDefaultDateFormat
    • widget_theysaidso_widget
    • expirationdateDisplayFooter
    • theysaidso_admin_options
    • postexpiratorVersion
    • db_upgraded
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 120× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/post-expirator/legacy/classes/Cli.class.php
    • > /wp-content/plugins/post-expirator/src/Views/menu-diagnostics.php
    • > /wp-content/plugins/post-expirator/src/Framework/WordPress/Facade/HooksFacade.php
    • > /wp-content/plugins/post-expirator/src/Framework/WordPress/Exceptions/NonexistentTermException.php
    • > /wp-content/plugins/post-expirator/src/Views/tabs.php
    • > /wp-content/plugins/post-expirator/src/Views/menu-defaults.php
    • > /wp-content/plugins/post-expirator/src/Modules/Expirator/ExpirationActions/PostCategoryRemove.php
    • > /wp-content/plugins/post-expirator/src/Framework/WordPress/Exceptions/WordPressErrorException.php
    • > /wp-content/plugins/post-expirator/legacy/classes/Facade.class.php
    • > /wp-content/plugins/post-expirator/src/Core/DI/ServiceProviderInterface.php
  • 65× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Store_Deprecated' not found in wp-content/plugins/post-expirator/lib/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Store.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_SimpleSchedule' not found in wp-content/plugins/post-expirator/lib/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_CanceledSchedule.php:6
    • > PHP Warning
      Class 'PublishPress\\WordpressVersionNotices\\Template\\TemplateNotFoundException' not found in wp-content/plugins/post-expirator/lib/vendor/publishpress/wordpress-version-notices/src/deprecated.php on line 34
    • > PHP Fatal error
      Uncaught Error: Interface 'ActionScheduler_Schedule' not found in wp-content/plugins/post-expirator/lib/vendor/woocommerce/action-scheduler/deprecated/ActionScheduler_Schedule_Deprecated.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'PublishPress\\Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/post-expirator/lib/vendor/publishpress/psr-container/lib/psr/container/src/NotFoundExceptionInterface.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'PublishPress\\Psr\\Container\otFoundExceptionInterface' not found in wp-content/plugins/post-expirator/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/post-expirator/lib/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_DayOfMonthField.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_QueueRunner' not found in wp-content/plugins/post-expirator/lib/vendor/woocommerce/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_QueueRunner.php:10
    • > PHP Warning
      Class 'PublishPress\\WordpressVersionNotices\\Template\\TemplateLoader' not found in wp-content/plugins/post-expirator/lib/vendor/publishpress/wordpress-version-notices/src/deprecated.php on line 19
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/post-expirator/lib/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_HoursField.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: schedule changes, expire posts, automatic changes, update posts

post-expirator/post-expirator.php Passed 13 tests

This is the main PHP file of "PublishPress Future: Automatically Unpublish WordPress Posts" version 3.1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
101 characters long description:
PublishPress Future allows you to schedule automatic changes to posts, pages and other content types.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected24,463 lines of code in 278 files:
LanguageFilesBlank linesComment linesLines of code
PHP2554,5279,73018,382
PO File51,2151,8583,157
CSS10169912,142
JSON300607
JavaScript54027175

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity8.00
▷ Minimum class complexity1.00
▷ Maximum class complexity97.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces44
Interfaces21
Traits0
Classes190
▷ Abstract classes2613.68%
▷ Concrete classes16486.32%
▷ Final classes21.22%
Methods1,235
▷ Static methods13711.09%
▷ Public methods97478.87%
▷ Protected methods15012.15%
▷ Private methods1118.99%
Functions174
▷ Named functions6939.66%
▷ Anonymous functions10560.34%
Constants238
▷ Global constants3615.13%
▷ Class constants20284.87%
▷ Public constants202100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
13 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/lib/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png0.38KB0.15KB▼ 61.54%
assets/css/lib/jquery-ui/images/ui-icons_222222_256x240.png6.86KB4.18KB▼ 39.05%
assets/css/lib/jquery-ui/images/ui-icons_888888_256x240.png6.94KB4.18KB▼ 39.78%
assets/css/lib/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png0.38KB0.12KB▼ 67.68%
assets/css/lib/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png0.26KB0.09KB▼ 66.79%