84% content-expiration

Code Review | Content Expiration

WordPress plugin Content Expiration scored 84% from 54 tests.

About plugin

  • Plugin page: content-expiration
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.0
  • WordPress version: 6.3.1
  • First release: Apr 14, 2017
  • Latest release: Mar 18, 2019
  • Number of updates: 6
  • Update frequency: every 117.2 days
  • Top authors: srg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 1,424 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼7.99ms] Passed 4 tests

An overview of server-side resources used by Content Expiration
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0741.56 ▲0.76
Dashboard /wp-admin3.37 ▲0.0644.10 ▼4.55
Posts /wp-admin/edit.php3.42 ▲0.0646.93 ▼6.65
Add New Post /wp-admin/post-new.php5.97 ▲0.0983.37 ▼21.09
Media Library /wp-admin/upload.php3.29 ▲0.0634.72 ▲0.35

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Content Expiration: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.22 ▼1.431.68 ▼0.1243.96 ▼0.51
Dashboard /wp-admin2,203 ▲125.79 ▲0.90104.76 ▲3.9938.98 ▼5.37
Posts /wp-admin/edit.php2,096 ▲71.99 ▼0.0139.80 ▼0.8633.81 ▼1.79
Add New Post /wp-admin/post-new.php6,858 ▲5,33019.98 ▼3.14903.85 ▲290.7452.81 ▼0.37
Media Library /wp-admin/upload.php1,391 ▲64.25 ▲0.0294.97 ▼6.1643.65 ▲0.06

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/content-expiration/process-expirations.php
    • > /wp-content/plugins/content-expiration/content-expiration.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: expiration, posts, pages

content-expiration/content-expiration.php Passed 13 tests

"Content Expiration" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
117 characters long description:
Expirations for posts or pages. Expired content is hidden, never deleted. Email notifications are sent to the author.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin240 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP25661220
JavaScript10020

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity53.00
▷ Minimum class complexity53.00
▷ Maximum class complexity53.00
Average method complexity6.20
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin