84% head-last-post-section-widget

Code Review | Head Last Post Section Widget

WordPress plugin Head Last Post Section Widget scored84%from 54 tests.

About plugin

  • Plugin page: head-last-post-se...
  • Plugin version: 1.01
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.1
  • WordPress version: 6.3.1
  • First release: Feb 14, 2015
  • Latest release: Feb 14, 2015
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: lion2486 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /557 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.78ms] Passed 4 tests

A check of server-side resources used by Head Last Post Section Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.21 ▼5.02
Dashboard /wp-admin3.35 ▲0.0448.30 ▼1.50
Posts /wp-admin/edit.php3.40 ▲0.0449.78 ▲4.05
Add New Post /wp-admin/post-new.php5.93 ▲0.0482.56 ▼16.85
Media Library /wp-admin/upload.php3.27 ▲0.0435.30 ▲0.24

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Head Last Post Section Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.27 ▼1.121.69 ▼0.4639.73 ▼2.08
Dashboard /wp-admin2,206 ▲185.90 ▼0.01108.72 ▼8.8739.24 ▼4.40
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0340.16 ▲5.1034.80 ▼1.33
Add New Post /wp-admin/post-new.php1,533 ▲1423.14 ▼0.19619.46 ▼74.2858.27 ▲1.23
Media Library /wp-admin/upload.php1,388 ▼34.25 ▲0.0597.60 ▼2.1440.24 ▼5.37

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_headlastpostsection
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/head-last-post-section-widget/Head-last-post-section.php:18

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
No tags were found

head-last-post-section-widget/Head-last-post-section.php 92% from 13 tests

The main PHP file in "Head Last Post Section Widget" ver. 1.01 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("head-last-post-section-widget.php" instead of "Head-last-post-section.php")

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 plugin133 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13645133

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity25.00
▷ Minimum class complexity25.00
▷ Maximum class complexity25.00
Average method complexity5.80
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods5100.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

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin