83% recent-post-widget-thumbnail

Code Review | Recent Post Widget Thumbnail

WordPress plugin Recent Post Widget Thumbnail scored83%from 54 tests.

About plugin

  • Plugin page: recent-post-widge...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.4.2
  • WordPress version: 6.3.1
  • First release: Mar 25, 2016
  • Latest release: Apr 5, 2016
  • Number of updates: 9
  • Update frequency: every 1.2 days
  • Top authors: fervillz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /5,708 total downloads

Benchmarks

Plugin footprint 83% from 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.06MB] [CPU: ▼1.07ms] Passed 4 tests

An overview of server-side resources used by Recent Post Widget Thumbnail
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0542.02 ▲0.90
Dashboard /wp-admin3.36 ▲0.0650.92 ▼1.03
Posts /wp-admin/edit.php3.47 ▲0.1252.38 ▲1.38
Add New Post /wp-admin/post-new.php5.96 ▲0.0799.72 ▼3.36
Media Library /wp-admin/upload.php3.28 ▲0.0537.71 ▼0.79

Server storage [IO: ▲0.13MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_rpwt
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Recent Post Widget Thumbnail
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.28 ▼0.111.73 ▼0.0141.12 ▼5.34
Dashboard /wp-admin2,199 ▲185.63 ▼0.0894.20 ▼18.8742.31 ▼3.18
Posts /wp-admin/edit.php2,104 ▲41.98 ▲0.0440.30 ▲2.9235.20 ▲0.89
Add New Post /wp-admin/post-new.php1,532 ▲622.96 ▼0.42615.51 ▼88.5952.44 ▼6.67
Media Library /wp-admin/upload.php1,407 ▲74.18 ▼0.0896.51 ▼8.6542.84 ▼2.67

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_rpwt
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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 items
  • 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/recent-post-widget-thumbnail/widgets/recent-post-core.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed: You can look at the official readme.txt

recent-post-widget-thumbnail/rpwt.php 85% from 13 tests

"Recent Post Widget Thumbnail" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("recent-post-widget-thumbnail.php" instead of "rpwt.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 188 characters long)

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
Success! There were no dangerous files found in this plugin207 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP245116138
CSS211053
JavaScript141016

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity14.50
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity3.70
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.11MB with 0.09MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/thumbnail-default-gold.png28.72KB5.87KB▼ 79.57%
assets/images/thumbnail-default-green.png28.29KB5.73KB▼ 79.73%
assets/images/thumbnail-default-blue.png29.01KB5.96KB▼ 79.44%
assets/images/thumbnail-default-red.png28.41KB5.74KB▼ 79.81%