10% wp-dynamic-links

Code Review | WP Dynamic Links

WordPress plugin WP Dynamic Links scored 10% from 54 tests.

About plugin

  • Plugin page: wp-dynamic-links
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.1
  • WordPress version: 5.8.1
  • First release: Jan 14, 2014
  • Latest release: Feb 26, 2015
  • Number of updates: 7
  • Update frequency: every 58.4 days
  • Top authors: soflyy (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

300+ active / 8,703 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wp-dynamic-links/plugin.php+347
    Function create_function() is deprecated

Server metrics [RAM: ▼0.58MB] [CPU: ▼170.86ms] Passed 4 tests

Server-side resources used by WP Dynamic Links
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.2439.78 ▲9.01
Dashboard /wp-admin3.07 ▲0.0231.97 ▼22.02
Posts /wp-admin/edit.php3.07 ▼0.0334.94 ▼15.35
Add New Post /wp-admin/post-new.php3.07 ▼2.3631.95 ▼637.04
Media Library /wp-admin/upload.php3.07 ▲0.0729.19 ▼9.04
Create Link /wp-admin/admin.php?page=pmlc-admin-add3.0729.20
Edit Link /wp-admin/admin.php?page=pmlc-admin-edit3.0728.70
Statistics /wp-admin/admin.php?page=pmlc-admin-statistics3.0730.18
TinyMCE /wp-admin/admin.php?page=pmlc-admin-tinymce3.0729.87
Manage Links /wp-admin/admin.php?page=pmlc-admin-links3.0729.13
Settings /wp-admin/admin.php?page=pmlc-admin-settings3.0732.00

Server storage [IO: ▲2.64MB] [DB: ▲9.61MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 110 new files
Database: 6 new tables, 1 new option
New tables
wp_pmlc_automatches
wp_pmlc_geoipcountry
wp_pmlc_stats
wp_pmlc_destinations
wp_pmlc_links
wp_pmlc_rules
New WordPress options
PMLC_Plugin_Options

Browser metrics Passed 4 tests

WP Dynamic Links: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,748 ▲17616.27 ▲0.6014.29 ▲3.1450.73 ▼3.60
Dashboard /wp-admin3,006 ▲725.94 ▼0.23158.39 ▼11.80134.74 ▲8.37
Posts /wp-admin/edit.php2,797 ▲582.71 ▼0.0178.40 ▲4.6199.87 ▲5.17
Add New Post /wp-admin/post-new.php1,711 ▲13018.44 ▼0.43486.58 ▲69.10115.11 ▲1.32
Media Library /wp-admin/upload.php1,791 ▼314.97 ▼0.03149.53 ▼20.41152.22 ▲24.68
Create Link /wp-admin/admin.php?page=pmlc-admin-add4,4693.5397.77109.34
Edit Link /wp-admin/admin.php?page=pmlc-admin-edit4,4863.6193.38111.44
Statistics /wp-admin/admin.php?page=pmlc-admin-statistics1,2323.0666.3786.56
TinyMCE /wp-admin/admin.php?page=pmlc-admin-tinymce4902.6648.590.15
Manage Links /wp-admin/admin.php?page=pmlc-admin-links1,3423.0768.0283.68
Settings /wp-admin/admin.php?page=pmlc-admin-settings1,3963.0772.89101.66

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/wp-dynamic-links/actions/admin_init.php+6
    Function create_function() is deprecated
  • Zombie tables detected upon uninstall: 6 tables
    • wp_pmlc_destinations
    • wp_pmlc_geoipcountry
    • wp_pmlc_links
    • wp_pmlc_stats
    • wp_pmlc_automatches
    • wp_pmlc_rules
  • This plugin does not fully uninstall, leaving 1 option in the database
    • PMLC_Plugin_Options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 29 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pmlc-admin-settings
    • > Deprecated in wp-content/plugins/wp-dynamic-links/controllers/controller/admin.php+81
    Function create_function() is deprecated

SRP 50% from 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 following issues need your attention
  • 35× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PMLC_Controller_Admin' not found in wp-content/plugins/wp-dynamic-links/controllers/admin/statistics.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-dynamic-links/views/admin/edit/destination.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PMLC_Controller_Admin' not found in wp-content/plugins/wp-dynamic-links/controllers/admin/settings.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PMLC_Controller_Admin' not found in wp-content/plugins/wp-dynamic-links/controllers/admin/edit.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PMLC_Model_Record' not found in wp-content/plugins/wp-dynamic-links/models/destination/record.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'PMLC_Model' not found in wp-content/plugins/wp-dynamic-links/models/model/record.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PMLC_Model_List' not found in wp-content/plugins/wp-dynamic-links/models/stat/list.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-dynamic-links/views/admin/statistics/stats.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PMLC_Controller' not found in wp-content/plugins/wp-dynamic-links/controllers/controller/admin.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PMLC_Controller_Admin' not found in wp-content/plugins/wp-dynamic-links/controllers/admin/links.php:7

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)
Please fix the following browser errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pmlc-admin-settings
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-dynamic-links/static/js/jquery/jqplot/jquery.jqplot.js?ver=5.8.1 202:39 Uncaught TypeError: Cannot read properties of undefined (reading 'msie')
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pmlc-admin-settings
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-dynamic-links/static/js/jquery/jqplot/plugins/jqplot.categoryAxisRenderer.js?ver=5.8.1 50:46 Uncaught TypeError: $.jqplot.LinearAxisRenderer is not a constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pmlc-admin-settings
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-dynamic-links/static/js/jquery/jqplot/plugins/jqplot.dateAxisRenderer.js?ver=5.8.1 98:42 Uncaught TypeError: $.jqplot.LinearAxisRenderer is not a constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pmlc-admin-settings
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-dynamic-links/static/js/jquery/jqplot/plugins/jqplot.highlighter.js?ver=5.8.1 18:32 Uncaught TypeError: Cannot read properties of undefined (reading 'push')
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pmlc-admin-settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=5.8.1 1:31592 "jQuery.Deferred exception: this[binder] is not a function" "TypeError: this[binder] is not a function\n at s.fn.init.$.fn.tipsy (/wp-content/plugins/wp-dynamic-links/static/js/jquery/jquery.tipsy.js?ver=5.8.1:161:25)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-dynamic-links/static/js/admin.js?ver=5.8.1:8:14)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=5.8.1:2:30340)" undefined
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pmlc-admin-settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=5.8.1 1:31702 Uncaught TypeError: this[binder] is not a function
    • > GET request to /wp-admin/admin.php?page=pmlc-admin-tinymce
    • > Javascript (severe) in unknown
    /wp-includes/js/tinymce/tiny_mce_popup.js 32:26 Uncaught TypeError: Cannot read properties of undefined (reading 'EditorManager')
    • > GET request to /wp-admin/admin.php?page=pmlc-admin-tinymce
    • > Javascript (severe) in unknown
    /wp-includes/js/tinymce/utils/mctabs.js 14:38 Uncaught TypeError: Cannot read properties of undefined (reading 'windowManager')
    • > GET request to /wp-admin/admin.php?page=pmlc-admin-tinymce
    • > Javascript (severe) in unknown
    /wp-includes/js/tinymce/utils/form_utils.js 10:39 Uncaught TypeError: Cannot read properties of undefined (reading 'baseURI')
    • > GET request to /wp-admin/admin.php?page=pmlc-admin-tinymce
    • > Javascript (severe) in unknown
    /wp-includes/js/tinymce/tiny_mce_popup.js 114:27 Uncaught TypeError: Cannot read properties of undefined (reading 'plugin_url')

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: affiliate, geotarget, shortener, redirect, pretty...

wp-dynamic-links/plugin.php 92% from 13 tests

The main PHP script in "WP Dynamic Links" version 1.0.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-dynamic-links.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected13,734 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript139362,5519,092
PHP513227993,767
CSS58288875

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity15.61
▷ Minimum class complexity1.00
▷ Maximum class complexity132.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes28
▷ Abstract classes414.29%
▷ Concrete classes2485.71%
▷ Final classes14.17%
Methods116
▷ Static methods32.59%
▷ Public methods10590.52%
▷ Protected methods119.48%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants1173.33%
▷ Class constants426.67%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
19 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/img/help.png1.51KB0.61KB▼ 59.78%
static/js/jquery/css/smoothness/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
static/js/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
static/js/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
static/img/wizard-icon.png0.62KB0.67KB0.00%