78% yourls-link-creator

Code Review | YOURLS Link Creator

WordPress plugin YOURLS Link Creator scored78%from 54 tests.

About plugin

  • Plugin page: yourls-link-creator
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.4
  • WordPress version: 6.3.1
  • First release: Oct 11, 2012
  • Latest release: Feb 25, 2016
  • Number of updates: 42
  • Update frequency: every 29.3 days
  • Top authors: norcross (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

700+ active /24,525 total downloads

Benchmarks

Plugin footprint 83% 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.30MB] [CPU: ▼2.92ms] Passed 4 tests

An overview of server-side resources used by YOURLS Link Creator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1344.39 ▼5.09
Dashboard /wp-admin3.70 ▲0.3950.93 ▼2.78
Posts /wp-admin/edit.php3.75 ▲0.3957.59 ▼0.52
Add New Post /wp-admin/post-new.php6.24 ▲0.3498.80 ▼3.29
Media Library /wp-admin/upload.php3.56 ▲0.3240.80 ▲3.27
YOURLS Settings /wp-admin/options-general.php?page=yourls-settings3.5040.46

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for YOURLS Link Creator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.34 ▼0.021.63 ▼0.2941.96 ▼2.44
Dashboard /wp-admin2,193 ▲135.60 ▼0.0292.98 ▼7.1144.40 ▼1.78
Posts /wp-admin/edit.php2,130 ▲302.03 ▲0.0040.87 ▲1.7136.85 ▼0.59
Add New Post /wp-admin/post-new.php1,551 ▲2523.20 ▼0.50653.73 ▼49.7651.02 ▼3.55
Media Library /wp-admin/upload.php1,404 ▲74.20 ▼0.01101.20 ▼4.0341.93 ▼4.96
YOURLS Settings /wp-admin/options-general.php?page=yourls-settings1,1212.1633.2534.50

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% 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 server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=yourls-settings
    • > Notice in wp-content/plugins/yourls-link-creator/lib/settings.php+481
    Trying to access array offset on value of type null

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/yourls-link-creator/yourls-link-creator.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/yourls-link-creator/lib/global.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yourls-link-creator/lib/admin.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yourls-link-creator/lib/front.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yourls-link-creator/lib/settings.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yourls-link-creator/lib/ajax.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 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
3 plugin tags: yourls, shortlink, custom url

yourls-link-creator/yourls-link-creator.php 77% from 13 tests

This is the main PHP file of "YOURLS Link Creator" version 2.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin2,618 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP96441,0801,562
JavaScript4159212695
PO File18791214
CSS2336147

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity34.29
▷ Minimum class complexity7.00
▷ Maximum class complexity72.00
Average method complexity3.95
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods79
▷ Static methods4151.90%
▷ Public methods7797.47%
▷ Protected methods00.00%
▷ Private methods22.53%
Functions5
▷ Named functions5100.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
No PNG images were found in this plugin