68% related-posts-via-categories

Code Review | Related Posts via Categories

WordPress plugin Related Posts via Categories scored 68% from 54 tests.

About plugin

  • Plugin page: related-posts-via...
  • Plugin version: 2.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.5.2
  • WordPress version: 5.8.1
  • First release: Feb 22, 2011
  • Latest release: Jun 25, 2013
  • Number of updates: 25
  • Update frequency: every 34.2 days
  • Top authors: alphasis (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active / 67,035 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.91MB] [CPU: ▼175.42ms] Passed 4 tests

Server-side resources used by Related Posts via Categories
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0032.36 ▼6.37
Dashboard /wp-admin2.74 ▼0.3219.67 ▼33.49
Posts /wp-admin/edit.php2.74 ▼0.3721.96 ▼22.05
Add New Post /wp-admin/post-new.php2.74 ▼2.6921.07 ▼628.43
Media Library /wp-admin/upload.php2.74 ▼0.2615.87 ▼17.70
Related Posts via Categories /wp-admin/options-general.php?page=related-posts-via-categories2.7422.83

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 1 new option
New WordPress options
related_posts_via_categories

Browser metrics Passed 4 tests

Related Posts via Categories: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11216.04 ▲0.3712.48 ▲2.0747.33 ▲0.13
Dashboard /wp-admin2,972 ▲415.96 ▲0.03147.04 ▼5.30114.71 ▼2.83
Posts /wp-admin/edit.php2,741 ▲22.72 ▲0.0161.42 ▼6.0786.86 ▲0.45
Add New Post /wp-admin/post-new.php1,618 ▼2,07121.37 ▲6.33289.83 ▼181.70103.48 ▼2.80
Media Library /wp-admin/upload.php1,824 ▲145.03 ▲0.04161.66 ▲7.62106.54 ▼7.28
Related Posts via Categories /wp-admin/options-general.php?page=related-posts-via-categories1,8492.1359.29110.96

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method relatedPostsViaCategories_admin::add() should not be called statically
  • This plugin does not fully uninstall, leaving 1 option in the database
    • related_posts_via_categories

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=related-posts-via-categories
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method relatedPostsViaCategories_admin::add() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=related-posts-via-categories
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method relatedPostsViaCategories_admin::head() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=related-posts-via-categories
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method relatedPostsViaCategories_admin::admin() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=related-posts-via-categories
    • > Notice in wp-content/plugins/related-posts-via-categories/includes/admin.php+59
    Undefined index: submit

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/related-posts-via-categories/includes/admin.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/related-posts-via-categories/related-posts-via-categories.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Display ( If the user is not logged in. )), #2 (Display ( If the user is logged in. )), #3 (Settings » Related Posts via Categories), #4 (Related Posts via Categories - Options » Display), #5 (Related Posts via Categories - Options » Order), #6 (Related Posts via Categories - Options » Exclude), #7 (Related Posts via Categories - Options » Post types), #8 (Related Posts via Categories - Options » Promotion)
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt is a good inspiration

related-posts-via-categories/related-posts-via-categories.php 92% from 13 tests

"Related Posts via Categories" version 2.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 187 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
There were no executable files found in this plugin859 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP48819588
PO File312012271

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity28.33
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity17.40
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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
No PNG files were detected