83% links-shortcode

Code Review | Links shortcode

WordPress plugin Links shortcode scored83%from 54 tests.

About plugin

  • Plugin page: links-shortcode
  • Plugin version: 1.8.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.2.4
  • WordPress version: 6.3.1
  • First release: Nov 17, 2010
  • Latest release: Nov 10, 2019
  • Number of updates: 71
  • Update frequency: every 46.2 days
  • Top authors: maartenjs (83.1%)Apprique (18.31%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /41,590 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
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼0.91ms] Passed 4 tests

This is a short check of server-side resources used by Links shortcode
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1156.40 ▲10.31
Dashboard /wp-admin3.41 ▲0.1149.44 ▼2.10
Posts /wp-admin/edit.php3.47 ▲0.1151.28 ▲5.32
Add New Post /wp-admin/post-new.php5.99 ▲0.1187.66 ▼6.20
Media Library /wp-admin/upload.php3.34 ▲0.1138.61 ▼0.67
Links Shortcode /wp-admin/link-manager.php?page=links-shortcode-settings3.3232.46
Add New /wp-admin/link-add.php3.3238.93
Link Categories /wp-admin/edit-tags.php?taxonomy=link_category3.3335.23
All Links /wp-admin/link-manager.php3.3636.99

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 16 new options
New WordPress options
db_upgraded
linkssc_default_css
linkssc_order
widget_links
widget_recent-comments
linkssc_template
widget_recent-posts
linkssc_fbcolors
widget_theysaidso_widget
linkssc_howmany
...

Browser metrics Passed 4 tests

Checking browser requirements for Links shortcode
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲6814.72 ▲0.091.98 ▲0.2042.15 ▼3.57
Dashboard /wp-admin2,227 ▲505.55 ▼0.1285.47 ▼1.2342.59 ▼1.03
Posts /wp-admin/edit.php2,132 ▲322.01 ▲0.0235.22 ▼2.6138.51 ▲4.68
Add New Post /wp-admin/post-new.php1,555 ▲2023.15 ▲4.65677.62 ▲23.2259.16 ▼4.85
Media Library /wp-admin/upload.php1,438 ▲474.22 ▲0.06103.42 ▲0.5745.52 ▼3.35
Links Shortcode /wp-admin/link-manager.php?page=links-shortcode-settings1,0852.0230.5637.57
Add New /wp-admin/link-add.php1,6902.5546.3634.50
Link Categories /wp-admin/edit-tags.php?taxonomy=link_category1,3182.1225.8330.39
All Links /wp-admin/link-manager.php1,0761.6722.8532.38

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_links
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/links-shortcode/links-shortcode.php on line 11
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHWPINC/formatting.php' (include_path='.:/usr/share/php') in wp-content/plugins/links-shortcode/links-shortcode.php on line 11
    • > PHP Warning
      require_once(ABSPATHWPINC/formatting.php): failed to open stream: No such file or directory in wp-content/plugins/links-shortcode/links-shortcode.php on line 11
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/links-shortcode/links-shortcode.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: Please describe screenshot #3 in links-shortcode/assets to your readme.txt
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can take inspiration from this readme.txt

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

The principal PHP file in "Links shortcode" v. 1.8.3 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 144 characters long)

Code Analysis Passed 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 detected657 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP15857440
PO File16487163
CSS18054

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
emptystars.png2.59KB1.95KB▼ 24.64%
fullstars.png0.21KB0.11KB▼ 47.69%
emptystars-black.png2.58KB1.92KB▼ 25.84%