84% auto-expire-posts

Code Review | Auto Expire Posts

WordPress plugin Auto Expire Posts scored84%from 54 tests.

About plugin

  • Plugin page: auto-expire-posts
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.1.1
  • WordPress version: 6.3.1
  • First release: Mar 21, 2019
  • Latest release: Mar 21, 2019
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: lerougeliet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /767 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.11MB] [CPU: ▼12.04ms] Passed 4 tests

This is a short check of server-side resources used by Auto Expire Posts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.10 ▼1.49
Dashboard /wp-admin3.32 ▼0.0343.22 ▼14.71
Posts /wp-admin/edit.php3.37 ▲0.0144.15 ▼0.60
Add New Post /wp-admin/post-new.php5.46 ▼0.4366.08 ▼29.11
Media Library /wp-admin/upload.php3.24 ▲0.0132.92 ▼2.86

Server storage [IO: ▲0.04MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
auto_expire_posts_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Auto Expire Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7113.33 ▼1.311.65 ▼0.0536.75 ▼8.40
Dashboard /wp-admin2,223 ▲384.96 ▼1.00102.02 ▲5.3240.25 ▼1.85
Posts /wp-admin/edit.php2,106 ▲202.22 ▲0.1940.81 ▲5.6736.42 ▼1.43
Add New Post /wp-admin/post-new.php6,293 ▲4,77926.23 ▲8.79880.58 ▲226.0475.79 ▲18.62
Media Library /wp-admin/upload.php1,396 ▲54.36 ▲0.1298.03 ▼27.6439.67 ▼17.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • auto_expire_posts_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/auto-expire-posts/admin/partials/options.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/auto-expire-posts/admin/partials/metabox.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: posts, trash, expire

auto-expire-posts/auto-expire-posts.php Passed 13 tests

The main file in "Auto Expire Posts" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
42 characters long description:
Automatically expire posts at a given date

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected287 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP1279448276
JavaScript1106
CSS1005

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity3.67
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods26
▷ Static methods27.69%
▷ Public methods2284.62%
▷ Protected methods00.00%
▷ Private methods415.38%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected