62% visualmodo-related-posts

Code Review | Visualmodo Related Posts

WordPress plugin Visualmodo Related Posts scored62%from 54 tests.

About plugin

  • Plugin page: visualmodo-relate...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.5
  • WordPress version: 6.3.1
  • First release: Sep 18, 2019
  • Latest release: Nov 14, 2020
  • Number of updates: 8
  • Update frequency: every 52.9 days
  • Top authors: visualmodo (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /7,120 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.74MB] [CPU: ▼50.03ms] Passed 4 tests

Server-side resources used by Visualmodo Related Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.26 ▼0.2012.45 ▼36.94
Dashboard /wp-admin3.28 ▼0.0715.92 ▼46.08
Posts /wp-admin/edit.php3.28 ▼0.0815.32 ▼28.43
Add New Post /wp-admin/post-new.php3.28 ▼2.6114.14 ▼88.67
Media Library /wp-admin/upload.php3.28 ▲0.0516.35 ▼17.91

Server storage [IO: ▲3.74MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 415 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
widget_recent-comments
related_posts
redux_version_upgraded_from
theysaidso_admin_options
related_posts-transients
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Visualmodo Related Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲17913.32 ▼0.984.85 ▲2.7241.88 ▼0.59
Dashboard /wp-admin2,312 ▲1245.85 ▼0.0595.28 ▼14.4568.09 ▲23.63
Posts /wp-admin/edit.php2,142 ▲532.02 ▲0.0434.60 ▼2.4335.67 ▲2.06
Add New Post /wp-admin/post-new.php1,726 ▲21224.84 ▲7.34741.07 ▲65.7861.60 ▲8.46
Media Library /wp-admin/upload.php1,444 ▲564.15 ▼0.0697.47 ▼4.2948.86 ▲5.12
Settings /wp-admin/related-posts.php?page=related-posts-settings260.440.0915.64
Related Posts /wp-admin/related-posts.php260.440.076.30

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the visualmodo_related_posts_backend_style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • redux_version_upgraded_from
    • db_upgraded
    • related_posts-transients
    • theysaidso_admin_options
    • related_posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/visualmodo-related-posts/visualmodo-related-posts.php
  • 20× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/visualmodo-related-posts/includes/options/core/inc/extensions/customizer/inc/customizer_control.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Redux_Customizer_Control' not found in wp-content/plugins/visualmodo-related-posts/includes/options/core/inc/extensions/customizer/inc/customizer_fields.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/visualmodo-related-posts/includes/options/core/templates/panel/header.tpl.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Section' not found in wp-content/plugins/visualmodo-related-posts/includes/options/core/inc/extensions/customizer/inc/customizer_section.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/visualmodo-related-posts/includes/options/core/inc/welcome/views/changelog.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/visualmodo-related-posts/includes/options/core/inc/welcome/views/credits.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/visualmodo-related-posts/includes/options/core/inc/class.p.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/visualmodo-related-posts/includes/options/core/inc/fields/select/elusive-icons.php:312
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Section' not found in wp-content/plugins/visualmodo-related-posts/includes/options/core/inc/extensions/customizer/inc/customizer_devs.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/visualmodo-related-posts/includes/options/core/inc/welcome/views/support.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/related-posts.php?page=related-posts-settings
    • > Network (severe)
    wp-admin/related-posts.php?page=related-posts-settings - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/related-posts.php
    • > Network (severe)
    wp-admin/related-posts.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention: You can look at the official readme.txt

visualmodo-related-posts/visualmodo-related-posts.php 85% from 13 tests

The main file in "Visualmodo Related Posts" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 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
There were no executable files found in this plugin37,267 lines of code in 296 files:
LanguageFilesBlank linesComment linesLines of code
PHP1053,6825,37015,543
JavaScript852,5911,92911,977
Sass541,187607,580
SVG201947
JSON11840909
CSS482341258
LESS10053

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity32.34
▷ Minimum class complexity1.00
▷ Maximum class complexity883.00
Average method complexity6.57
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes101
▷ Abstract classes00.00%
▷ Concrete classes101100.00%
▷ Final classes00.00%
Methods569
▷ Static methods10217.93%
▷ Public methods42875.22%
▷ Protected methods9115.99%
▷ Private methods508.79%
Functions13
▷ Named functions1292.31%
▷ Anonymous functions17.69%
Constants58
▷ Global constants11.72%
▷ Class constants5798.28%
▷ Public constants57100.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
30 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/options/core/inc/fields/switch/slider-control.png1.65KB0.75KB▼ 54.62%
includes/options/core/assets/css/vendor/jquery-ui-bootstrap/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
includes/options/core/assets/img/toggle_tabs.png0.35KB0.35KB0.00%
includes/options/core/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
includes/options/core/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%