84% foreign-keys-pro

Code Review | Foreign Keys Pro

WordPress plugin Foreign Keys Pro scored84%from 54 tests.

About plugin

  • Plugin page: foreign-keys-pro
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.7.2
  • WordPress version: 6.3.1
  • First release: Nov 11, 2020
  • Latest release: May 19, 2021
  • Number of updates: 3
  • Update frequency: every 63.0 days
  • Top authors: bhubbard (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /343 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.57ms] Passed 4 tests

Server-side resources used by Foreign Keys Pro
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0337.57 ▼6.22
Dashboard /wp-admin3.34 ▲0.0347.48 ▼2.83
Posts /wp-admin/edit.php3.39 ▲0.0347.75 ▼0.27
Add New Post /wp-admin/post-new.php5.92 ▲0.0393.36 ▲4.61
Media Library /wp-admin/upload.php3.26 ▲0.0335.82 ▲3.06

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Foreign Keys Pro: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.57 ▼1.071.72 ▼0.3236.84 ▼8.55
Dashboard /wp-admin2,206 ▲214.82 ▼1.05109.40 ▼28.5842.65 ▼2.55
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0439.31 ▲2.8235.42 ▼0.46
Add New Post /wp-admin/post-new.php1,537 ▲1818.39 ▼4.90629.74 ▼52.5653.68 ▼2.04
Media Library /wp-admin/upload.php1,388 ▼34.20 ▼0.0195.72 ▼27.7144.96 ▼3.07

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means 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
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Unterminated comment starting line 4 in wp-content/plugins/foreign-keys-pro/includes/woocommerce.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/foreign-keys-pro/foreign-keys-pro.php:33

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === foreign-keys-pro === )
  • Screenshots: These screenshots do not have images: #1 (Example Screenshot), #2 (This is the second screen shot)
Please take inspiration from this readme.txt

foreign-keys-pro/foreign-keys-pro.php Passed 13 tests

The main PHP script in "Foreign Keys Pro" version 1.0.0 is automatically included on every request by WordPress
57 characters long description:
A plugin to setup Foreign Keys in the WordPress Database.

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
Success! There were no dangerous files found in this plugin196 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5111117160
JSON10013
XML13912
Markdown19011

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin