73% categories-expiration-date

Code Review | Automatic Expiration for Categories

WordPress plugin Automatic Expiration for Categories scored73%from 54 tests.

About plugin

  • Plugin page: categories-expira...
  • Plugin version: 0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Sep 10, 2018
  • Latest release: Jun 10, 2021
  • Number of updates: 5
  • Update frequency: every 224.4 days
  • Top authors: brightvesseldev (80%)niloybrightvessel (40%)

Code review

54 tests

User reviews

8 reviews

Install metrics

20+ active /1,076 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▲1.52ms] Passed 4 tests

Server-side resources used by Automatic Expiration for Categories
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1844.87 ▲1.33
Dashboard /wp-admin3.35 ▲0.0553.05 ▲3.53
Posts /wp-admin/edit.php3.40 ▲0.0449.48 ▲2.36
Add New Post /wp-admin/post-new.php5.95 ▲0.0789.92 ▼1.13
Media Library /wp-admin/upload.php3.28 ▲0.0544.14 ▲11.52
Categories Expiration /wp-admin/options-general.php?page=brightvessel-categories-expiration3.2635.51

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 9 new files
Database: 1 new table, 6 new options
New tables
wp_categories_expiration
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Automatic Expiration for Categories
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6014.82 ▲0.441.84 ▼0.1243.56 ▼1.52
Dashboard /wp-admin2,215 ▲274.85 ▼0.05106.69 ▼9.0243.67 ▼2.39
Posts /wp-admin/edit.php2,095 ▲32.02 ▲0.0134.64 ▼4.5136.21 ▼1.08
Add New Post /wp-admin/post-new.php1,519 ▼1417.40 ▼5.81594.59 ▼76.5945.00 ▼17.69
Media Library /wp-admin/upload.php1,388 ▼04.19 ▼0.0095.82 ▼7.7641.03 ▼4.49
Categories Expiration /wp-admin/options-general.php?page=brightvessel-categories-expiration9502.0425.4355.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 1 table
    • wp_categories_expiration
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

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 fix the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/categories-expiration-date/etc/install.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/categories-expiration-date/views/categories.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/categories-expiration-date/views/assignations.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/categories-expiration-date/views/footer.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/categories-expiration-date/views/tokens.php:18

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png)
You can take inspiration from this readme.txt

categories-expiration-date/main.php 85% from 13 tests

The main PHP file in "Automatic Expiration for Categories" ver. 0.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("categories-expiration-date.php" instead of "main.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin575 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP65326406
CSS1100169

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions1292.31%
▷ Anonymous functions17.69%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/bv-logo.png8.12KB4.49KB▼ 44.75%