10% a5-recent-posts

Code Review | A5 Recent Post Widget

WordPress plugin A5 Recent Post Widget scored 10% from 54 tests.

About plugin

  • Plugin page: a5-recent-posts
  • Plugin version: 2.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.5
  • WordPress version: 5.8.1
  • First release: Feb 24, 2014
  • Latest release: Apr 9, 2016
  • Number of updates: 26
  • Update frequency: every 29.8 days
  • Top authors: tepelstreel (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

80+ active / 4,182 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/a5-recent-posts/class-lib/RPW_WidgetClass.php+470
    Function create_function() is deprecated

Server metrics [RAM: ▼1.33MB] [CPU: ▼184.31ms] Passed 4 tests

Analyzing server-side resources used by A5 Recent Post Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.31 ▼0.417.75 ▼11.33
Dashboard /wp-admin2.32 ▼0.739.73 ▼36.32
Posts /wp-admin/edit.php2.32 ▼0.788.16 ▼36.43
Add New Post /wp-admin/post-new.php2.32 ▼3.117.59 ▼637.75
Media Library /wp-admin/upload.php2.32 ▼0.687.50 ▼26.73
A5 Recent Posts /wp-admin/options-general.php?page=a5-recent-posts-settings2.338.90

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 19 new files
Database: no new tables, 2 new options
New WordPress options
rpw_options
widget_a5_recent_post_widget

Browser metrics Passed 4 tests

Checking browser requirements for A5 Recent Post Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,716 ▲12015.89 ▲0.3510.95 ▼1.3245.35 ▼0.65
Dashboard /wp-admin2,983 ▲495.89 ▼0.05148.96 ▼4.81141.35 ▲32.63
Posts /wp-admin/edit.php2,762 ▲232.59 ▼0.1165.95 ▼3.1583.39 ▲0.36
Add New Post /wp-admin/post-new.php1,684 ▲1218.70 ▼0.22360.92 ▼32.39105.37 ▼2.30
Media Library /wp-admin/upload.php1,767 ▼405.01 ▼0.01141.51 ▼9.81132.53 ▲22.67
A5 Recent Posts /wp-admin/options-general.php?page=a5-recent-posts-settings1,4653.9091.1189.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/a5-recent-posts/class-lib/RPW_WidgetClass.php+470
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_a5_recent_post_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=a5-recent-posts-settings
    • > Deprecated in wp-content/plugins/a5-recent-posts/class-lib/RPW_WidgetClass.php+470
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=a5-recent-posts-settings
    • > Notice in wp-content/plugins/a5-recent-posts/class-lib/RPW_AdminClass.php+156
    Undefined index: link
    • > GET request to /wp-admin/options-general.php?page=a5-recent-posts-settings
    • > Notice in wp-content/plugins/a5-recent-posts/class-lib/RPW_AdminClass.php+162
    Undefined index: hover

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
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'A5_DynamicFiles' not found in wp-content/plugins/a5-recent-posts/class-lib/RPW_DynamicCSSClass.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/a5-recent-posts/class-lib/A5_WidgetClass.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'A5_Widget' not found in wp-content/plugins/a5-recent-posts/class-lib/RPW_WidgetClass.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'A5_OptionPage' not found in wp-content/plugins/a5-recent-posts/class-lib/RPW_AdminClass.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=a5-recent-posts-settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1 1:31592 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/a5-recent-posts/ta-expander.min.js?ver=3.0:1:2865)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1:2:30340)" undefined
    • > GET request to /wp-admin/options-general.php?page=a5-recent-posts-settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1 1:31702 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: recent posts, newspaper, sticky posts, flexible, post...

a5-recent-posts/a5-recent-posts.php 92% from 13 tests

Analyzing the main PHP file in "A5 Recent Post Widget" version 2.6.1
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 174 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected2,326 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP101,4735311,837
PO File1101104315
JavaScript26919174

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity32.00
▷ Minimum class complexity11.00
▷ Maximum class complexity76.00
Average method complexity4.26
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods95
▷ Static methods3435.79%
▷ Public methods8690.53%
▷ Protected methods00.00%
▷ Private methods99.47%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/a5-icon-11.png0.67KB0.42KB▼ 37.17%
img/a5-icon-34.png1.65KB1.35KB▼ 18.07%