89% wen-post-expiry-notification

Code Review | WEN Post Expiry Notification

WordPress plugin WEN Post Expiry Notification scored 89% from 54 tests.

About plugin

  • Plugin page: wen-post-expiry-n...
  • Plugin version: 1.1
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.2.2
  • WordPress version: 5.8.1
  • First release: Jul 31, 2019
  • Latest release: Aug 2, 2019
  • Number of updates: 6
  • Update frequency: every 0.5 days
  • Top authors: webexpertsnepal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 368 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼142.70ms] Passed 4 tests

Server-side resources used by WEN Post Expiry Notification
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1332.25 ▲12.16
Dashboard /wp-admin3.17 ▲0.1147.38 ▲0.05
Posts /wp-admin/edit.php3.28 ▲0.1744.50 ▼2.56
Add New Post /wp-admin/post-new.php5.53 ▲0.1092.44 ▼566.31
Media Library /wp-admin/upload.php3.11 ▲0.1030.28 ▼1.97
WEN Post Expiry Notification /wp-admin/options-general.php?page=wpen3.1231.64

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for WEN Post Expiry Notification
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,726 ▲13016.52 ▲0.8113.09 ▲2.1548.46 ▼0.64
Dashboard /wp-admin2,993 ▲636.14 ▼0.09153.02 ▼27.79107.65 ▼5.03
Posts /wp-admin/edit.php2,762 ▲232.75 ▲0.0473.02 ▲4.4983.52 ▼3.81
Add New Post /wp-admin/post-new.php1,701 ▲1818.80 ▲0.03403.10 ▼17.01108.28 ▲1.39
Media Library /wp-admin/upload.php1,833 ▲235.10 ▲0.08158.64 ▲5.86115.61 ▼5.05
WEN Post Expiry Notification /wp-admin/options-general.php?page=wpen1,7556.94154.17128.07

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wen-post-expiry-notification/wen-post-expiry-notification.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wen-post-expiry-notification/inc/post-expiry-meta-boxes.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wen-post-expiry-notification/inc/class-wen-post-expiry-notification.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wen-post-expiry-notification/inc/class-wpen-admin-settings.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wen-post-expiry-notification/inc/template/post-expiry-email-template.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

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
2 plugin tags: expiry notification, post expiry

wen-post-expiry-notification/wen-post-expiry-notification.php Passed 13 tests

The primary PHP file in "WEN Post Expiry Notification" version 1.1 is used by WordPress to initiate all plugin functionality
92 characters long description:
Set expiry date on posts and custom post types, and send email notification on their expiry.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,740 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS241491,235
PHP510518473
SVG10124
JavaScript1108

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity13.33
▷ Minimum class complexity3.00
▷ Maximum class complexity27.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png5.87KB2.78KB▼ 52.67%
assets/icon-128x128.png4.43KB3.06KB▼ 30.83%