56% short-links-and-traffic

Code Review | Short Links and Traffic

WordPress plugin Short Links and Traffic scored 56% from 54 tests.

About plugin

  • Plugin page: short-links-and-t...
  • Plugin version: 0.0.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9
  • WordPress version: 6.3.1
  • First release: Nov 21, 2017
  • Latest release: Dec 4, 2017
  • Number of updates: 4
  • Update frequency: every 3.3 days
  • Top authors: klickonit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 606 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.24MB] [CPU: ▼36.17ms] Passed 4 tests

This is a short check of server-side resources used by Short Links and Traffic
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.435.12 ▼32.77
Dashboard /wp-admin3.01 ▼0.3024.99 ▼24.46
Posts /wp-admin/edit.php3.01 ▼0.3523.57 ▼21.91
Add New Post /wp-admin/post-new.php3.01 ▼2.8824.77 ▼65.54
Media Library /wp-admin/upload.php3.01 ▼0.2221.82 ▼11.18
Short Links and Traffic /wp-admin/options-general.php?page=klick_slt3.0126.65

Server storage [IO: ▲0.30MB] [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: 54 new files
Database: 1 new table, 8 new options
New tables
wp_slt_details
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
klick-slt-logging
widget_theysaidso_widget
theysaidso_admin_options
slt_details_db_version
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Short Links and Traffic
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲16413.53 ▼0.915.80 ▲3.9842.43 ▲3.59
Dashboard /wp-admin2,213 ▲255.82 ▲0.9297.93 ▼4.7036.74 ▼4.26
Posts /wp-admin/edit.php2,105 ▲162.03 ▲0.0336.95 ▲0.2630.94 ▼3.84
Add New Post /wp-admin/post-new.php1,526 ▼723.55 ▲0.46617.22 ▼61.3558.83 ▲7.22
Media Library /wp-admin/upload.php1,401 ▲134.21 ▲0.0195.54 ▼13.7742.20 ▼5.88
Short Links and Traffic /wp-admin/options-general.php?page=klick_slt1,4832.1625.4734.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • slt_details_db_version
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=klick_slt
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 14× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/short-links-and-traffic/includes/class-klick-slt-abstract-logger.php
    • > /wp-content/plugins/short-links-and-traffic/includes/class-klick-slt-commands.php
    • > /wp-content/plugins/short-links-and-traffic/templates/notices-templates/horizontal-notice.php
    • > /wp-content/plugins/short-links-and-traffic/templates/klick-slt-tab-change-log.php
    • > /wp-content/plugins/short-links-and-traffic/includes/class-klick-slt-dashboard.php
    • > /wp-content/plugins/short-links-and-traffic/includes/class-klick-slt-php-logger.php
    • > /wp-content/plugins/short-links-and-traffic/includes/class-klick-slt-redirection.php
    • > /wp-content/plugins/short-links-and-traffic/includes/class-klick-slt-abstract-notice.php
    • > /wp-content/plugins/short-links-and-traffic/short-links-and-traffic.php
    • > /wp-content/plugins/short-links-and-traffic/templates/notices-templates/main-dashboard-notices.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant KLICK_SLT_PLUGIN_URL - assumed 'KLICK_SLT_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/short-links-and-traffic/templates/klick-slt-tab-links.php on line 8
    • > PHP Warning
      Use of undefined constant KLICK_SLT_PLUGIN_URL - assumed 'KLICK_SLT_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/short-links-and-traffic/templates/klick-slt-tab-our-other-plugins.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function klick_slt() in wp-content/plugins/short-links-and-traffic/templates/klick-slt-tab-links.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/short-links-and-traffic/templates/klick-slt-tab-our-other-plugins.php:3

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)
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=klick_slt
    • > Network (severe)
    wp-content/plugins/short-links-and-traffic//images/our-more-plugins/APV.svg - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=klick_slt
    • > Network (severe)
    wp-content/plugins/short-links-and-traffic//images/our-more-plugins/ATS.svg - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Short Links and Traffic Add Tab), #2 (Short Links and Traffic List Tab)
Please take inspiration from this readme.txt

short-links-and-traffic/short-links-and-traffic.php 92% from 13 tests

The primary PHP file in "Short Links and Traffic" version 0.0.2 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin2,313 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP19303537999
SVG11011521
CSS62612511
JavaScript437160238
Markdown124044

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity10.67
▷ Minimum class complexity1.00
▷ Maximum class complexity33.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes216.67%
▷ Concrete classes1083.33%
▷ Final classes00.00%
Methods81
▷ Static methods67.41%
▷ Public methods8098.77%
▷ Protected methods00.00%
▷ Private methods11.23%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.13MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/notices/apv_sample_notice_icon2.png9.63KB4.69KB▼ 51.23%
images/small_icon.png18.12KB0.45KB▼ 97.52%
images/klick-on-it.png6.51KB4.02KB▼ 38.23%
images/slt-banner.png43.05KB21.50KB▼ 50.06%
images/notices/apv_sample_notice_icon3.png30.17KB6.04KB▼ 79.98%