84% tcp-referrer-shortcode

Code Review | TCP Referrer Shortcode

WordPress plugin TCP Referrer Shortcode scored84%from 54 tests.

About plugin

  • Plugin page: tcp-referrer-shor...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.8.4
  • WordPress version: 6.3.1
  • First release: Sep 21, 2020
  • Latest release: Mar 30, 2022
  • Number of updates: 6
  • Update frequency: every 93.0 days
  • Top authors: tcpteam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /465 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.09MB] [CPU: ▼13.42ms] 75% from 4 tests

Analyzing server-side resources used by TCP Referrer Shortcode
Please fix the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 898.23ms on /wp-admin/admin.php?page=thecartpress)
PageMemory (MB)CPU Time (ms)
Home /2.91 ▼0.5617.57 ▼18.91
Dashboard /wp-admin3.39 ▲0.0447.16 ▼12.92
Posts /wp-admin/edit.php3.50 ▲0.1449.22 ▼1.66
Add New Post /wp-admin/post-new.php5.97 ▲0.0881.06 ▼20.17
Media Library /wp-admin/upload.php3.31 ▲0.0835.03 ▲0.51
TCP Plugins /wp-admin/admin.php?page=thecartpress3.38898.23
Referrer Shortcode /wp-admin/admin.php?page=tcp_referrer_shortcode3.2826.94

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for TCP Referrer Shortcode
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.24 ▼0.291.63 ▲0.0544.07 ▼0.53
Dashboard /wp-admin2,212 ▲385.53 ▼0.1179.84 ▼7.2675.73 ▲34.00
Posts /wp-admin/edit.php2,126 ▲231.99 ▼0.0036.33 ▼12.3731.83 ▼6.15
Add New Post /wp-admin/post-new.php1,555 ▲2923.08 ▼0.14748.51 ▲73.4754.76 ▼6.12
Media Library /wp-admin/upload.php1,432 ▲324.23 ▼0.1797.53 ▼5.3675.26 ▲31.58
TCP Plugins /wp-admin/admin.php?page=thecartpress9452.0526.5431.20
Referrer Shortcode /wp-admin/admin.php?page=tcp_referrer_shortcode8181.9923.5223.16

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

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

Smoke tests 75% from 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 | 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tcp_referrer_shortcode
    • > Network (severe)
    wp-content/plugins/tcp-referrer-shortcode/assets/images/tcp-icon.svg - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tcp_referrer_shortcode
    • > Network (severe)
    wp-content/plugins/tcp-referrer-shortcode/assets/css/menu.css?ver=6.3.1 - 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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: referer, referrer, shortcode, woocommerce, thecartpress...

tcp-referrer-shortcode/tcp-referrer-shortcode.php Passed 13 tests

"TCP Referrer Shortcode" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
54 characters long description:
Replace shortcode with referrer by using [tcp_referer]

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 plugin464 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP261145464

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.52
Average class complexity13.00
▷ Minimum class complexity2.00
▷ Maximum class complexity21.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods20
▷ Static methods15.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions1173.33%
▷ Anonymous functions426.67%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin