80% posts-2-posts-relationships

Code Review | Posts 2 Posts Relationships

WordPress plugin Posts 2 Posts Relationships scored 80% from 54 tests.

About plugin

  • Plugin page: posts-2-posts-rel...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 6.3.1
  • First release: Jul 7, 2021
  • Latest release: Jul 19, 2021
  • Number of updates: 8
  • Update frequency: every 1.5 days
  • Top authors: wpcentrics (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 749 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

Analyzing server-side resources used by Posts 2 Posts Relationships
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.28 ▲0.85
Dashboard /wp-admin3.33 ▲0.0259.79 ▲7.04
Posts /wp-admin/edit.php3.38 ▲0.0247.77 ▼6.27
Add New Post /wp-admin/post-new.php5.93 ▲0.0491.67 ▼0.75
Media Library /wp-admin/upload.php3.25 ▲0.0237.28 ▲1.91
P2P Relationships /wp-admin/options-general.php?page=p2p-relationships-opts3.4332.44

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 36 new files
Database: 1 new table, 7 new options
New tables
wp_p2p_relationships
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
p2p-relationships
can_compress_scripts

Browser metrics Passed 4 tests

Posts 2 Posts Relationships: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲2713.24 ▲0.071.96 ▲0.3541.58 ▲4.30
Dashboard /wp-admin2,205 ▲135.10 ▲0.24108.81 ▼2.5637.43 ▼5.71
Posts /wp-admin/edit.php2,098 ▲62.25 ▲0.1937.61 ▼9.6135.02 ▼3.72
Add New Post /wp-admin/post-new.php1,521 ▼1223.48 ▲0.02677.94 ▼20.5937.77 ▼17.99
Media Library /wp-admin/upload.php1,390 ▲24.23 ▲0.0795.81 ▼2.1445.67 ▼3.28
P2P Relationships /wp-admin/options-general.php?page=p2p-relationships-opts1,3472.3131.7228.94

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_p2p_relationships
  • The uninstall procedure has failed, leaving 7 options in the database
    • p2p-relationships
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 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 Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: many-to-many, custom post types, posts relationships, posts 2 posts, posts to posts

posts-2-posts-relationships/posts-2-posts-relationships.php Passed 13 tests

The main PHP file in "Posts 2 Posts Relationships" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
78 characters long description:
Efficient many-to-many connections between posts, pages and custom post types.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin15,234 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript73,1491,07312,155
CSS4208271,369
PHP73683711,148
PO File4216219562

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity133.00
▷ Minimum class complexity133.00
▷ Maximum class complexity133.00
Average method complexity5.71
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods28
▷ Static methods13.57%
▷ Public methods28100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/js/select2/3/select2x2.png0.64KB0.77KB0.00%
assets/js/select2/3/select2.png0.51KB0.99KB0.00%