83% easy-related-posts

Code Review | Easy Related Posts

WordPress plugin Easy Related Posts scored83%from 54 tests.

About plugin

  • Plugin page: easy-related-posts
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Apr 30, 2013
  • Latest release: Sep 16, 2014
  • Number of updates: 50
  • Update frequency: every 10.1 days
  • Top authors: xdark.eu (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

300+ active /23,883 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.27MB] [CPU: ▼0.66ms] Passed 4 tests

An overview of server-side resources used by Easy Related Posts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2140.03 ▲3.19
Dashboard /wp-admin3.64 ▲0.3347.49 ▼4.49
Posts /wp-admin/edit.php3.69 ▲0.3350.73 ▲1.75
Add New Post /wp-admin/post-new.php6.16 ▲0.2786.56 ▼3.07
Media Library /wp-admin/upload.php3.50 ▲0.2736.77 ▲3.83
Easy Related Posts /wp-admin/options-general.php?page=erp_settings3.8239.54

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 156 new files
Database: no new tables, 10 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_erp_widget
erpVersionNumbers
theysaidso_admin_options
widget_recent-comments
erp_main_options
widget_theysaidso_widget
WPAdminNotices
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Easy Related Posts
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,889 ▲15413.67 ▼0.895.80 ▲3.9340.79 ▲3.13
Dashboard /wp-admin2,210 ▲224.85 ▼0.01109.45 ▼7.6444.36 ▼2.22
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0540.95 ▲1.8135.78 ▲1.18
Add New Post /wp-admin/post-new.php1,517 ▲317.49 ▼0.03676.90 ▼65.2252.61 ▲0.03
Media Library /wp-admin/upload.php1,383 ▼84.22 ▼0.00103.12 ▼2.4940.89 ▼1.61
Easy Related Posts /wp-admin/options-general.php?page=erp_settings2,2812.8994.4341.17

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • WPAdminNotices

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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 take a closer look at the following
  • 62× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: widgetInstance in wp-content/plugins/easy-related-posts/front/views/widget/BasicList/settings.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to a member function getExcerpt() on null in wp-content/plugins/easy-related-posts/front/views/widget/Basic/components/excerpt.php:5
    • > PHP Notice
      Undefined variable: widgetInstance in wp-content/plugins/easy-related-posts/front/views/widget/Basic/settings.php on line 15
    • > PHP Notice
      Undefined variable: widgetInstance in wp-content/plugins/easy-related-posts/front/views/widget/BasicDivs/settings.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to a member function getThumbnail() on null in wp-content/plugins/easy-related-posts/front/views/widget/Basic/components/thumbnail.php:4
    • > PHP Notice
      Undefined variable: v in wp-content/plugins/easy-related-posts/front/views/main/Fixed_slider/components/thumbnail.php on line 4
    • > PHP Notice
      Undefined variable: v in wp-content/plugins/easy-related-posts/front/views/widget/BasicDivs/components/title.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to a member function getExcerpt() on null in wp-content/plugins/easy-related-posts/front/views/main/Grid/components/excerpt.php:5
    • > PHP Notice
      Undefined variable: v in wp-content/plugins/easy-related-posts/front/views/widget/Basic/components/excerpt.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'erpPaths' not found in wp-content/plugins/easy-related-posts/core/options/erpMainOpts.php:11

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, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid url: ""
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
Please take inspiration from this readme.txt

easy-related-posts/easy_related_posts.php 85% from 13 tests

The main PHP script in "Easy Related Posts" version 2.0.2 is automatically included on every request by WordPress
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("easy-related-posts.php" instead of "easy_related_posts.php")

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 plugin7,562 lines of code in 73 files:
LanguageFilesBlank linesComment linesLines of code
PHP487862,6154,530
CSS13801322,680
JavaScript1259116352

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity16.57
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes411.43%
▷ Concrete classes3188.57%
▷ Final classes00.00%
Methods277
▷ Static methods5620.22%
▷ Public methods23584.84%
▷ Protected methods145.05%
▷ Private methods2810.11%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants17
▷ Global constants635.29%
▷ Class constants1164.71%
▷ Public constants11100.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
30 PNG files occupy 0.35MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
front/assets/img/noImage.png19.16KB7.96KB▼ 58.46%
admin/assets/css/images/ui-bg_glass_20_555555_1x400.png0.25KB0.15KB▼ 40.38%
admin/assets/css/images/ui-bg_flat_0_aaaaaa_40x100.png0.21KB0.08KB▼ 58.96%
admin/assets/css/images/ui-bg_glass_40_0078a3_1x400.png0.33KB0.16KB▼ 52.05%
admin/assets/css/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%