89% related-posts-for-wpml

Code Review | Related Posts for WPML

WordPress plugin Related Posts for WPML scored 89% from 54 tests.

About plugin

  • Plugin page: related-posts-for...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.2
  • WordPress version: 5.8.1
  • First release: Nov 4, 2016
  • Latest release: Aug 1, 2020
  • Number of updates: 3
  • Update frequency: every 455.3 days
  • Top authors: ghz1990 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 557 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼141.62ms] Passed 4 tests

An overview of server-side resources used by Related Posts for WPML
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0232.69 ▼0.81
Dashboard /wp-admin3.08 ▲0.0246.45 ▼2.19
Posts /wp-admin/edit.php3.13 ▲0.0247.70 ▲0.98
Add New Post /wp-admin/post-new.php5.44 ▲0.0091.17 ▼556.34
Media Library /wp-admin/upload.php3.02 ▲0.0231.22 ▼7.13

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Related Posts for WPML
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8816.24 ▲0.269.70 ▼0.5745.22 ▼4.39
Dashboard /wp-admin2,975 ▲385.93 ▼0.05141.68 ▼15.85112.33 ▲2.58
Posts /wp-admin/edit.php2,744 ▲52.72 ▼0.0064.03 ▼8.1686.35 ▼9.02
Add New Post /wp-admin/post-new.php1,875 ▲27119.08 ▲0.36391.29 ▲23.06104.81 ▼5.25
Media Library /wp-admin/upload.php1,812 ▲55.06 ▲0.00152.47 ▼15.92109.36 ▼9.13
Related Posts for WPML /wp-admin/init-related-posts.php260.900.0811.82

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 50% 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/related-posts-for-wpml/main-page.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/related-posts-for-wpml/init-related-posts.php:23

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/init-related-posts.php
    • > Network (severe)
    wp-admin/init-related-posts.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: wpml, related posts

related-posts-for-wpml/related-posts-for-wpml.php Passed 13 tests

Analyzing the main PHP file in "Related Posts for WPML" version 1.1
44 characters long description:
Related posts by tags for multilanguage WPML

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
There were no executable files found in this plugin192 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP36337192

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity6.00
▷ Minimum class complexity3.00
▷ Maximum class complexity9.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods350.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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 images were found in this plugin