93% amity-related-posts

Code Review | Amity Related Posts

WordPress plugin Amity Related Posts scored 93% from 54 tests.

About plugin

  • Plugin page: amity-related-posts
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.3.1
  • WordPress version: 5.8.1
  • First release: Sep 17, 2015
  • Latest release: Oct 17, 2015
  • Number of updates: 32
  • Update frequency: every 1.4 days
  • Top authors: amityTheme (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active / 1,695 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼140.45ms] Passed 4 tests

Analyzing server-side resources used by Amity Related Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1434.11 ▲8.05
Dashboard /wp-admin3.33 ▲0.2852.73 ▲2.55
Posts /wp-admin/edit.php3.38 ▲0.2755.88 ▲7.99
Add New Post /wp-admin/post-new.php5.60 ▲0.1792.93 ▼574.53
Media Library /wp-admin/upload.php3.19 ▲0.1934.95 ▲2.21
ARP Options /wp-admin/options-general.php?page=amity-related-posts3.1938.14

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 2 new options
New WordPress options
arp_styles
arp_basics

Browser metrics Passed 4 tests

A check of browser resources used by Amity Related Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,014 ▲40818.27 ▲2.6721.72 ▲8.3747.38 ▲0.31
Dashboard /wp-admin3,192 ▲2598.07 ▲2.10197.23 ▲6.54115.64 ▼2.10
Posts /wp-admin/edit.php3,006 ▲2674.36 ▲1.6499.38 ▲26.78100.31 ▲8.48
Add New Post /wp-admin/post-new.php1,626 ▲1118.60 ▼2.56415.90 ▲103.64113.82 ▼0.81
Media Library /wp-admin/upload.php1,837 ▲894.91 ▼0.09132.93 ▼45.70120.57 ▼10.15
ARP Options /wp-admin/options-general.php?page=amity-related-posts3,7255.71174.6987.07

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'AmityTheme_Settings_API' not found in wp-content/plugins/amity-related-posts/admin/amity-settings-api.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function arp_get_option() in wp-content/plugins/amity-related-posts/inc/style-css.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === amity-related-posts === )
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

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

The entry point to "Amity Related Posts" version 1.4 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: Keep the plugin description shorter than 140 characters (currently 191 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin928 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP5222236773
CSS1398155

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity26.00
▷ Minimum class complexity3.00
▷ Maximum class complexity49.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin