10% older-posts-widget

Code Review | Older Posts Widget

WordPress plugin Older Posts Widget scored 10% from 54 tests.

About plugin

  • Plugin page: older-posts-widget
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.3
  • WordPress version: 6.3.1
  • First release: Jan 2, 2012
  • Latest release: Jan 19, 2012
  • Number of updates: 8
  • Update frequency: every 2.5 days
  • Top authors: techallica (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active / 3,024 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/older-posts-widget/older-posts-widget.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; GHGPostWidget has a deprecated constructor

Server metrics [RAM: ▼1.71MB] [CPU: ▼49.45ms] Passed 4 tests

An overview of server-side resources used by Older Posts Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.189.59 ▼37.09
Dashboard /wp-admin2.29 ▼1.0110.49 ▼35.97
Posts /wp-admin/edit.php2.29 ▼1.069.46 ▼38.48
Add New Post /wp-admin/post-new.php2.29 ▼3.5910.80 ▼86.24
Media Library /wp-admin/upload.php2.29 ▼0.949.66 ▼26.00

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_ghgpostwidget
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Older Posts Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.76 ▲0.381.83 ▲0.1042.90 ▼9.21
Dashboard /wp-admin2,206 ▲215.84 ▼0.03113.28 ▲10.7241.24 ▲0.32
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0234.71 ▼2.0936.65 ▲3.74
Add New Post /wp-admin/post-new.php1,514 ▼2817.71 ▼0.58639.16 ▲2.5258.84 ▲0.26
Media Library /wp-admin/upload.php1,391 ▲34.15 ▲0.0795.98 ▼1.4841.20 ▼1.70

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in GHGPostWidget is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_ghgpostwidget
    • widget_theysaidso_widget

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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/older-posts-widget/older-posts-widget.php:12

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 93% from 29 tests

readme.txt 88% 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
Attributes that require attention:
  • Screenshots: Screenshot #1 (The widget settings menu.) image missing
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === older-posts-widget === )
Please take inspiration from this readme.txt

older-posts-widget/older-posts-widget.php Passed 13 tests

The main file in "Older Posts Widget" v. 2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
48 characters long description:
A widget to show specific number of older posts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin75 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1111475

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png8.09KB6.52KB▼ 19.45%