84% local-links

Code Review | Local Links

WordPress plugin Local Links scored84%from 54 tests.

About plugin

  • Plugin page: local-links
  • Plugin version: 4.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 4, 2019
  • Latest release: Oct 18, 2023
  • Number of updates: 62
  • Update frequency: every 27.7 days
  • Top authors: avantman42 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /2,250 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.13MB] [CPU: ▼1.20ms] Passed 4 tests

This is a short check of server-side resources used by Local Links
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1546.08 ▲5.27
Dashboard /wp-admin3.43 ▲0.1350.30 ▼5.60
Posts /wp-admin/edit.php3.48 ▲0.1350.79 ▲2.71
Add New Post /wp-admin/post-new.php6.01 ▲0.1386.87 ▼6.82
Media Library /wp-admin/upload.php3.35 ▲0.1340.15 ▲4.93
Local Links /wp-admin/options-general.php?page=locallinks_config3.3233.56

Server storage [IO: ▲0.09MB] [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: 10 new files
Database: no new tables, 44 new options
New WordPress options
locallinks_googleaff
db_upgraded
locallinks_amazon
locallinks_mx
locallinks_obsaff
locallinks_se
locallinks_bsaff
can_compress_scripts
locallinks_aplaff
locallinks_kobo
...

Browser metrics Passed 4 tests

Local Links: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,890 ▲14413.68 ▼0.6012.68 ▲10.9739.47 ▼5.20
Dashboard /wp-admin2,199 ▲225.51 ▼0.0884.18 ▼2.7935.79 ▼7.41
Posts /wp-admin/edit.php2,104 ▲41.98 ▲0.0034.37 ▼7.8630.25 ▼5.96
Add New Post /wp-admin/post-new.php1,529 ▲123.64 ▲0.57698.88 ▲38.2453.73 ▼8.14
Media Library /wp-admin/upload.php1,404 ▲44.22 ▲0.0494.79 ▼2.3240.54 ▼4.79
Local Links /wp-admin/options-general.php?page=locallinks_config1,2392.1226.0125.93

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • locallinks_plugin_version
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/local-links/local-links.php:119
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/local-links/public/replacelinks.php:274

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues 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
These attributes need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
Please take inspiration from this readme.txt

local-links/local-links.php 92% from 13 tests

"Local Links" version 4.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 204 characters long)

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
Everything looks great! No dangerous files found in this plugin1,118 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP3105135852
JavaScript252112266

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin