84% recent-posts-widget-plus

Code Review | Recent Posts Widget Plus

WordPress plugin Recent Posts Widget Plus scored84%from 54 tests.

About plugin

  • Plugin page: recent-posts-widg...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9.3-6.4
  • WordPress version: 6.3.1
  • First release: Jun 26, 2012
  • Latest release: Oct 30, 2023
  • Number of updates: 30
  • Update frequency: every 138.1 days
  • Top authors: vanderwijk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

900+ active /25,494 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.54ms] Passed 4 tests

This is a short check of server-side resources used by Recent Posts Widget Plus
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0335.60 ▼4.43
Dashboard /wp-admin3.34 ▲0.0345.46 ▼0.61
Posts /wp-admin/edit.php3.39 ▲0.0346.78 ▼0.53
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.57 ▼4.57
Media Library /wp-admin/upload.php3.27 ▲0.0335.62 ▲1.74

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
widget_recentpostswidgetplus
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Recent Posts Widget Plus
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.351.68 ▲0.1040.97 ▲0.22
Dashboard /wp-admin2,198 ▲175.59 ▼0.1389.06 ▼10.3540.12 ▲0.42
Posts /wp-admin/edit.php2,097 ▼32.00 ▼0.0239.89 ▲3.7635.39 ▼1.96
Add New Post /wp-admin/post-new.php1,531 ▲523.46 ▼0.20654.70 ▼52.1547.81 ▼8.34
Media Library /wp-admin/upload.php1,400 ▼34.30 ▲0.1298.06 ▼2.5640.90 ▼2.22

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recentpostswidgetplus
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/recent-posts-widget-plus/recent-posts-widget-plus.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (You can set the widget title, the number of posts, the length of the excerpt and select a category to display the recent posts from or choose to display the recent posts with a certain tag.), #2 (This is an example of how the widget can look.)
The official readme.txt is a good inspiration

recent-posts-widget-plus/recent-posts-widget-plus.php 92% from 13 tests

The primary PHP file in "Recent Posts Widget Plus" version 1.2.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 154 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected124 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP12723121
Markdown1203

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png19.86KB10.00KB▼ 49.63%
screenshot-2.png37.33KB16.47KB▼ 55.89%