73% delete-old-posts-programmatically

Code Review | Delete old Posts automatically

WordPress plugin Delete old Posts automatically scored73%from 54 tests.

About plugin

  • Plugin page: delete-old-posts-...
  • Plugin version: 3.5.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Apr 21, 2021
  • Latest release: Nov 20, 2023
  • Number of updates: 100
  • Update frequency: every 9.4 days
  • Top authors: wpmagics (100%)

Code review

54 tests

User reviews

1 review

Install metrics

900+ active /16,017 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲5.11MB] [CPU: ▲25.80ms] 75% from 4 tests

Server-side resources used by Delete old Posts automatically
Please take the time to fix the following items
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.11MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.89 ▲5.4264.92 ▲19.25
Dashboard /wp-admin8.91 ▲5.6077.73 ▲29.11
Posts /wp-admin/edit.php8.91 ▲5.5583.13 ▲30.95
Add New Post /wp-admin/post-new.php9.75 ▲3.86117.74 ▲23.88
Media Library /wp-admin/upload.php8.91 ▲5.6868.41 ▲31.94
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.9163.93

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 214 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
fs_debug_mode
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
fs_accounts
fs_active_plugins
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Delete old Posts automatically
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲5714.31 ▼0.031.70 ▼0.2529.57 ▼14.29
Dashboard /wp-admin2,227 ▲505.49 ▼0.1096.88 ▲2.8245.88 ▲1.38
Posts /wp-admin/edit.php2,133 ▲331.97 ▲0.0342.22 ▲2.4937.69 ▲2.56
Add New Post /wp-admin/post-new.php1,541 ▲1523.17 ▲0.05741.71 ▲32.1556.29 ▼7.60
Media Library /wp-admin/upload.php1,429 ▲294.25 ▲0.0797.08 ▼0.0945.58 ▲2.79
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0841.6525.3728.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/delete-old-posts-programmatically/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • fs_accounts
    • widget_recent-posts
    • db_upgraded
    • fs_debug_mode
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • fs_active_plugins

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'DEL\\OLD\\Posts\\Cls\\Delete_Old_Posts' not found in wp-content/plugins/delete-old-posts-programmatically/inc/class-delete-old-posts-redirects.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'DEL\\OLD\\Posts\\Cls\\Delete_Old_Posts' not found in wp-content/plugins/delete-old-posts-programmatically/inc/class-delete-old-posts-filters.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: There are too many tags (17 tag instead of maximum 10)
You can look at the official readme.txt

delete-old-posts-programmatically/delete-old-posts.php 85% from 13 tests

Analyzing the main PHP file in "Delete old Posts automatically" version 3.5.2
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("delete-old-posts-programmatically.php" instead of "delete-old-posts.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin45,078 lines of code in 160 files:
LanguageFilesBlank linesComment linesLines of code
PHP1258,28217,83435,250
JSON3004,356
PO File99079203,808
CSS153331201,263
JavaScript73974400
Markdown1001

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity85.42
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.69
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes56
▷ Abstract classes23.57%
▷ Concrete classes5496.43%
▷ Final classes00.00%
Methods1,331
▷ Static methods19914.95%
▷ Public methods92769.65%
▷ Protected methods171.28%
▷ Private methods38729.08%
Functions103
▷ Named functions103100.00%
▷ Anonymous functions00.00%
Constants145
▷ Global constants9867.59%
▷ Class constants4732.41%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/blog_delete_40694.png4.00KB2.12KB▼ 46.95%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%