84% expiring-posts

Code Review | Expiring Posts

WordPress plugin Expiring Posts scored84%from 54 tests.

About plugin

  • Plugin page: expiring-posts
  • Plugin version: 1.3
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 6.3.1
  • First release: Mar 21, 2019
  • Latest release: Jan 24, 2022
  • Number of updates: 8
  • Update frequency: every 130.0 days
  • Top authors: ivankk (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /3,187 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

This is a short check of server-side resources used by Expiring Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0939.02 ▼5.67
Dashboard /wp-admin3.39 ▲0.0848.92 ▼3.59
Posts /wp-admin/edit.php3.44 ▲0.0847.31 ▼1.98
Add New Post /wp-admin/post-new.php5.99 ▲0.1085.80 ▼13.49
Media Library /wp-admin/upload.php3.31 ▲0.0835.44 ▲2.21

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Expiring Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.26 ▼1.161.80 ▼0.2043.34 ▲0.65
Dashboard /wp-admin2,209 ▲215.84 ▲0.9496.81 ▼7.1844.21 ▲4.01
Posts /wp-admin/edit.php2,092 ▲32.00 ▲0.0335.63 ▼4.7734.52 ▼3.22
Add New Post /wp-admin/post-new.php1,521 ▲217.74 ▼5.63634.77 ▲35.5064.47 ▲15.95
Media Library /wp-admin/upload.php1,391 ▼04.38 ▲0.1896.90 ▼0.0841.75 ▲0.62

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/expiring-posts/expiring-posts.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

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
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (By default a post never expires.), #2 (But you can add a date instead.)
You can take inspiration from this readme.txt

expiring-posts/expiring-posts.php Passed 13 tests

"Expiring Posts" version 1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
76 characters long description:
Allows a post to move to a new status for expired posts on a specified date.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin435 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1135176331
JavaScript118875
CSS16029

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity70.00
▷ Minimum class complexity70.00
▷ Maximum class complexity70.00
Average method complexity5.60
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods16.67%
▷ Public methods1493.33%
▷ Protected methods00.00%
▷ Private methods16.67%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG images were found in this plugin