10% related-posts-slider

Code Review | Related Posts Slider

WordPress plugin Related Posts Slider scored 10% from 54 tests.

About plugin

  • Plugin page: related-posts-slider
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4.1
  • WordPress version: 5.9.2
  • First release: Jan 7, 2011
  • Latest release: Feb 1, 2016
  • Number of updates: 14
  • Update frequency: every 132.2 days
  • Top authors: internet techies (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

500+ active / 89,791 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
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/related-posts-slider/related-posts-slider.php+243
    Methods with the same name as their class will not be constructors in a future version of PHP; CF5_RPS_Widget has a deprecated constructor

Server metrics [RAM: ▼2.43MB] [CPU: ▼341.60ms] Passed 4 tests

Server-side resources used by Related Posts Slider
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.94 ▼1.573.80 ▼50.18
Dashboard /wp-admin1.96 ▼1.453.30 ▼31.17
Posts /wp-admin/edit.php1.96 ▼1.684.76 ▼31.61
Add New Post /wp-admin/post-new.php1.96 ▼5.014.15 ▼1,253.45
Media Library /wp-admin/upload.php1.96 ▼1.333.56 ▼21.85
Related Posts Slider /wp-admin/options-general.php?page=rps-settings1.965.01

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 39 new files
Database: no new tables, 2 new options
New WordPress options
cf5_rps_options
widget_cf5_rps_wid

Browser metrics Passed 4 tests

An overview of browser requirements for Related Posts Slider
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,920 ▲17816.20 ▲0.528.70 ▲3.162.65 ▲0.57
Dashboard /wp-admin2,897 ▲366.25 ▲0.07129.07 ▼4.57160.27 ▼2.39
Posts /wp-admin/edit.php2,701 ▲103.26 ▲0.0267.08 ▲4.00142.57 ▼4.24
Add New Post /wp-admin/post-new.php1,664 ▼5516.63 ▼5.31416.03 ▼19.97157.61 ▲1.96
Media Library /wp-admin/upload.php1,703 ▲85.54 ▲0.01136.92 ▼10.50185.48 ▼4.63
Related Posts Slider /wp-admin/options-general.php?page=rps-settings4,5614.17110.55176.77

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
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/related-posts-slider/related-posts-slider.php+243
    Methods with the same name as their class will not be constructors in a future version of PHP; CF5_RPS_Widget has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_cf5_rps_wid

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=rps-settings
    • > Deprecated in wp-content/plugins/related-posts-slider/related-posts-slider.php+243
    Methods with the same name as their class will not be constructors in a future version of PHP; CF5_RPS_Widget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=rps-settings
    • > Deprecated in wp-content/plugins/related-posts-slider/related-posts-slider.php+269
    Function create_function() is deprecated

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
The following issues need your attention
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/related-posts-slider/related-posts-slider.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/related-posts-slider/includes/settings.php:536
    • > PHP Notice
      Undefined variable: cf5_rps in wp-content/plugins/related-posts-slider/includes/settings.php on line 35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function delete_option() in wp-content/plugins/related-posts-slider/uninstall.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_theme_support() in wp-content/plugins/related-posts-slider/includes/cf5-rps-get-the-image.php:27
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/related-posts-slider/includes/settings.php on line 35

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (18 tag instead of maximum 10)
  • Screenshots: These screenshots require images: #1 (Various Sections of the Related Posts Slider (all can be customized thru Settings Page) (with clean-blue design)), #2 (Second slider format - Horizontal carousel)
You can look at the official readme.txt

related-posts-slider/related-posts-slider.php 92% from 13 tests

The primary PHP file in "Related Posts Slider" version 2.2 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 202 characters long)

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
Everything looks great! No dangerous files found in this plugin4,310 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript43662642,370
CSS671912
PHP6143186791
PO File1112129237

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.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%
Functions37
▷ Named functions37100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
19 PNG files occupy 0.28MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png22.68KB21.57KB▼ 4.87%
styles/clean-blue/images/prev.png2.86KB0.32KB▼ 88.82%
styles/default/images/next.png2.87KB0.32KB▼ 88.77%
styles/cf5/images/next.png2.87KB0.32KB▼ 88.77%
formats/h_carousel/styles/plain/next-horizontal.png3.73KB0.85KB▼ 77.22%