94% hide-related-posts

Code Review | Hide Related Posts

WordPress plugin Hide Related Posts scored 94% from 54 tests.

About plugin

  • Plugin page: hide-related-posts
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.1
  • WordPress version: 5.8.1
  • First release: Nov 4, 2021
  • Latest release: Nov 8, 2021
  • Number of updates: 5
  • Update frequency: every 1.0 days
  • Top authors: elymkattaf (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 26 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼146.45ms] Passed 4 tests

Server-side resources used by Hide Related Posts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1236.97 ▲16.54
Dashboard /wp-admin3.07 ▲0.0250.29 ▲1.73
Posts /wp-admin/edit.php3.13 ▲0.0148.53 ▼16.10
Add New Post /wp-admin/post-new.php5.43 ▼0.0195.61 ▼572.47
Media Library /wp-admin/upload.php3.02 ▲0.0134.73 ▲1.04
Hide Related Posts /wp-admin/options-general.php?page=hide_related_posts2.9930.18

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hide Related Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.96 ▲0.419.68 ▲0.2453.84 ▲7.19
Dashboard /wp-admin2,980 ▲465.85 ▼0.31144.17 ▼21.45120.72 ▼8.09
Posts /wp-admin/edit.php2,746 ▲72.82 ▲0.1473.10 ▼14.7794.37 ▼11.06
Add New Post /wp-admin/post-new.php1,688 ▲518.78 ▲0.23378.98 ▼22.38117.04 ▼7.22
Media Library /wp-admin/upload.php1,814 ▲105.01 ▼0.02162.42 ▼3.70133.58 ▲8.04
Hide Related Posts /wp-admin/options-general.php?page=hide_related_posts1,0362.0953.7780.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/hide-related-posts/index.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: hide, posts, related

hide-related-posts/index.php 92% from 13 tests

The main PHP script in "Hide Related Posts" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hide-related-posts.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin58 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP115953
CSS1005

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/correct.png4.81KB2.57KB▼ 46.61%
(invalid) assets/icon-128x128.png5.81KB0.00KB▼ 100.00%