78% simple-alert-for-old-post

Code Review | Simple Alert for Old Post

WordPress plugin Simple Alert for Old Post scored 78% from 54 tests.

About plugin

  • Plugin page: simple-alert-for-...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.5
  • WordPress version: 6.3.1
  • First release: Apr 20, 2016
  • Latest release: Apr 21, 2016
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: Potato4d (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 971 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

Server-side resources used by Simple Alert for Old Post
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0842.49 ▲6.27
Dashboard /wp-admin3.36 ▲0.0646.26 ▼2.11
Posts /wp-admin/edit.php3.47 ▲0.1247.91 ▼1.87
Add New Post /wp-admin/post-new.php5.96 ▲0.0799.72 ▼9.55
Media Library /wp-admin/upload.php3.28 ▲0.0538.07 ▲2.43
Alert Settings /wp-admin/options-general.php?page=simple-alert-for-old-post3.2733.30

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Alert for Old Post
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲8113.28 ▼0.941.80 ▲0.0144.32 ▼2.41
Dashboard /wp-admin2,218 ▲304.85 ▼0.02111.52 ▲0.3543.12 ▲1.01
Posts /wp-admin/edit.php2,104 ▲152.01 ▼0.0341.74 ▲0.5936.90 ▲0.10
Add New Post /wp-admin/post-new.php1,534 ▼018.54 ▼4.65601.89 ▼0.8261.42 ▲7.21
Media Library /wp-admin/upload.php1,400 ▲154.29 ▲0.0696.06 ▼4.0643.30 ▼14.02
Alert Settings /wp-admin/options-general.php?page=simple-alert-for-old-post1,0012.1825.2629.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/simple-alert-for-old-post/res/views/notice_error.php
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/simple-alert-for-old-post/res/views/settings_main.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/simple-alert-for-old-post/res/views/notice_update.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-alert-for-old-post/simple-alert-for-old-post.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/simple-alert-for-old-post/tests/test-admin.php:4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/simple-alert-for-old-post/res/views/notice_error.php on line 3
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/simple-alert-for-old-post/res/views/notice_error.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/simple-alert-for-old-post/tests/test-simple-alert-for-old-post.php:4
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/simple-alert-for-old-post/tests/bootstrap.php on line 8
    • > PHP Notice
      Trying to get property 'errors' of non-object in wp-content/plugins/simple-alert-for-old-post/res/views/notice_error.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/simple-alert-for-old-post/tests/bootstrap.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: posts, text, post

simple-alert-for-old-post/simple-alert-for-old-post.php Passed 13 tests

Analyzing the main PHP file in "Simple Alert for Old Post" version 1.0.1
43 characters long description:
This is the show alert plugin for old post.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin1,113 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP811646414
SVG222149
JavaScript42637114
Sass618095
Bourne Shell120694
CSS416291
PO File1342791
Markdown114032
JSON10019
XML10014

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity6.75
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.74
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods1651.61%
▷ Protected methods00.00%
▷ Private methods1548.39%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.95MB with 0.69MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/screenshots/screenshot-2.png254.79KB69.56KB▼ 72.70%
src/screenshots/screenshot-1.png612.79KB177.75KB▼ 70.99%
src/screenshots/screenshot-3.png107.62KB29.53KB▼ 72.56%