83% wp-related-post-with-pagination

Code Review | WP Related Post With Pagination

WordPress plugin WP Related Post With Pagination scored83%from 54 tests.

About plugin

  • Plugin page: wp-related-post-w...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-5.2.3
  • WordPress version: 6.3.1
  • First release: Jan 7, 2020
  • Latest release: Jan 7, 2020
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: ashish.jangra (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /435 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼0.88ms] Passed 4 tests

A check of server-side resources used by WP Related Post With Pagination
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1336.09 ▼7.33
Dashboard /wp-admin3.42 ▲0.1259.97 ▲3.26
Posts /wp-admin/edit.php3.54 ▲0.1854.27 ▲0.49
Add New Post /wp-admin/post-new.php6.01 ▲0.1292.35 ▲0.06
Media Library /wp-admin/upload.php3.35 ▲0.1242.11 ▲4.68

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_wprelatedposts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WP Related Post With Pagination
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲13613.29 ▼1.078.53 ▲6.9538.65 ▼6.86
Dashboard /wp-admin2,195 ▲185.68 ▲0.1591.16 ▼5.3639.71 ▲0.11
Posts /wp-admin/edit.php2,103 ▲31.98 ▼0.0336.08 ▼5.9337.56 ▼3.92
Add New Post /wp-admin/post-new.php1,535 ▲725.09 ▲2.00656.71 ▲39.9976.60 ▲27.02
Media Library /wp-admin/upload.php1,403 ▼04.16 ▼0.01112.88 ▲13.2347.48 ▲5.70

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_wprelatedposts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_permalink() in wp-content/plugins/wp-related-post-with-pagination/templates/related-post.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-related-post-with-pagination/related-post.php:12

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

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #2 (Widget Preview) image missing
The official readme.txt might help

wp-related-post-with-pagination/related-post.php 85% from 13 tests

"WP Related Post With Pagination" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-related-post-with-pagination.php" instead of "related-post.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 165 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected544 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP312783480
JavaScript114152
CSS10012

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity46.00
▷ Minimum class complexity1.00
▷ Maximum class complexity104.00
Average method complexity10.00
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods16.67%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin