78% post-auto-expire-control

Code Review | Posts Auto Expire Control

WordPress plugin Posts Auto Expire Control scored78%from 54 tests.

About plugin

  • Plugin page: post-auto-expire-...
  • Plugin version: 0.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.6
  • WordPress version: 6.3.1
  • First release: Oct 12, 2012
  • Latest release: Sep 11, 2013
  • Number of updates: 32
  • Update frequency: every 10.4 days
  • Top authors: WP_Dummy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /6,551 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼9.85ms] Passed 4 tests

A check of server-side resources used by Posts Auto Expire Control
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0939.20 ▲2.72
Dashboard /wp-admin3.40 ▲0.0649.87 ▼15.56
Posts /wp-admin/edit.php3.52 ▲0.1649.65 ▲4.23
Add New Post /wp-admin/post-new.php5.98 ▲0.1088.82 ▼30.80
Media Library /wp-admin/upload.php3.33 ▲0.1041.16 ▲6.02
Posts Auto Expire Control /wp-admin/options-general.php?page=apext_setting3.3433.84

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
apextmail
widget_theysaidso_widget
apext
db_upgraded
apext_ver
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Posts Auto Expire Control
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲2214.34 ▼0.291.57 ▼0.2541.39 ▼2.26
Dashboard /wp-admin2,196 ▲165.61 ▼0.0485.17 ▼6.6141.01 ▼2.43
Posts /wp-admin/edit.php2,107 ▲102.00 ▲0.0234.53 ▼2.1333.24 ▼3.94
Add New Post /wp-admin/post-new.php1,533 ▲723.17 ▼0.41682.11 ▼1.6953.90 ▼5.79
Media Library /wp-admin/upload.php1,398 ▼24.30 ▲0.1096.31 ▼11.0243.41 ▼4.48
Posts Auto Expire Control /wp-admin/options-general.php?page=apext_setting1,1172.1827.4239.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • apext_ver
    • apextmail
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • apext

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/post-auto-expire-control/html/render_output.php:3
    • > PHP Notice
      Undefined index: day in wp-content/plugins/post-auto-expire-control/html/add_rule_ajax.php on line 5
    • > PHP Notice
      Undefined index: counter in wp-content/plugins/post-auto-expire-control/html/add_rule_ajax.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/post-auto-expire-control/html/add_rule_ajax.php:8
    • > PHP Notice
      Undefined index: status in wp-content/plugins/post-auto-expire-control/html/add_rule_ajax.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/post-auto-expire-control/html/add_rule_form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/post-auto-expire-control/html/mailsetting.php:2
    • > PHP Notice
      Undefined index: cpt in wp-content/plugins/post-auto-expire-control/html/add_rule_ajax.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/post-auto-expire-control/post-auto-expire-control.php:457
    • > PHP Notice
      Undefined index: role in wp-content/plugins/post-auto-expire-control/html/add_rule_ajax.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=apext_setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/post-auto-expire-control/js/jscontrol.js?ver=1.0:22:18)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=apext_setting
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Post expiration rules table), #2 (Auto post expiration email notification control panel)
The official readme.txt might help

post-auto-expire-control/post-auto-expire-control.php Passed 13 tests

The primary PHP file in "Posts Auto Expire Control" version 0.1.3 is used by WordPress to initiate all plugin functionality
94 characters long description:
this plugin helps you to set your author post expiration based on the user role and post type.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin746 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP513942540
PO File14571101
JavaScript128591
CSS20014

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity44.00
▷ Minimum class complexity44.00
▷ Maximum class complexity44.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin