72% 5-anker-connect

Code Review | 5 Anker Connect

WordPress plugin 5 Anker Connect scored 72% from 54 tests.

About plugin

  • Plugin page: 5-anker-connect
  • Plugin version: 1.3.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.0
  • WordPress version: 6.3.1
  • First release: Sep 22, 2020
  • Latest release: Oct 27, 2022
  • Number of updates: 27
  • Update frequency: every 28.3 days
  • Top authors: 5anker (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,860 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.43MB] [CPU: ▼0.66ms] Passed 4 tests

This is a short check of server-side resources used by 5 Anker Connect
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4639.56 ▼2.03
Dashboard /wp-admin3.74 ▲0.4453.22 ▲5.91
Posts /wp-admin/edit.php3.79 ▲0.4449.52 ▲1.55
Add New Post /wp-admin/post-new.php6.58 ▲0.7097.23 ▼6.43
Media Library /wp-admin/upload.php3.60 ▲0.3737.53 ▲4.29
5 Anker Connect /wp-admin/options-general.php?page=5-anker-connect3.5733.25

Server storage [IO: ▲0.32MB] [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: 143 new files
Database: no new tables, 7 new options
New WordPress options
connect_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

5 Anker Connect: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,881 ▲12415.44 ▲0.823.19 ▲1.2042.82 ▲2.43
Dashboard /wp-admin2,226 ▲386.47 ▲0.60131.93 ▲15.3638.44 ▼5.56
Posts /wp-admin/edit.php2,114 ▲253.70 ▲1.6680.93 ▲39.8636.32 ▲1.79
Add New Post /wp-admin/post-new.php6,505 ▲4,96821.97 ▼1.12937.41 ▲295.2038.50 ▼16.77
Media Library /wp-admin/upload.php1,411 ▲235.29 ▲1.10130.76 ▲23.7144.50 ▼2.09
5 Anker Connect /wp-admin/options-general.php?page=5-anker-connect8793.3057.6623.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • connect_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/5-anker-connect/admin/partials/anker-connect-admin-display.php
    • > /wp-content/plugins/5-anker-connect/public/partials/anker-connect-public-display.php
  • 40× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'SiteOrigin_Widget' not found in wp-content/plugins/5-anker-connect/lib/siteorigin/cruise-slider/cruise-slider.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/5-anker-connect/lib/blocks/wls-newsletter.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/5-anker-connect/lib/blocks/wls-search.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/5-anker-connect/lib/blocks/wls-map.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/5-anker-connect/lib/blocks/wls-boats.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/5-anker-connect/lib/blocks/wls-search-watercamper.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/5-anker-connect/lib/blocks/wls-boats-grid.php:62
    • > PHP Fatal error
      Uncaught Error: Class 'SiteOrigin_Widget' not found in wp-content/plugins/5-anker-connect/lib/siteorigin/boat/boat.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'SiteOrigin_Widget' not found in wp-content/plugins/5-anker-connect/lib/siteorigin/boat-book-calendar/boat-book-calendar.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/5-anker-connect/lib/blocks/wls-marina.php:62

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=5-anker-connect
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=hoverIntent,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 3:1808 Uncaught TypeError: Cannot set properties of undefined (setting 'wrap')
    • > GET request to /wp-admin/options-general.php?page=5-anker-connect
    • > Javascript (severe) in unknown
    /wp-includes/js/dist/i18n.min.js?ver=7701b0c3857f914212ef 1:9135 Uncaught TypeError: Cannot read properties of undefined (reading 'defaultHooks')
    • > GET request to /wp-admin/options-general.php?page=5-anker-connect
    • > Javascript (severe) in unknown
    /wp-admin/options-general.php?page=5-anker-connect 201:8 Uncaught TypeError: Cannot read properties of undefined (reading 'setLocaleData')
    • > GET request to /wp-admin/options-general.php?page=5-anker-connect
    • > Javascript (severe) in unknown
    /wp-admin/js/common.min.js?ver=6.3.1 1:69 Uncaught TypeError: Cannot read properties of undefined (reading '__')

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: importer, 5anker, charter

5-anker-connect/anker-connect.php 92% from 13 tests

Analyzing the main PHP file in "5 Anker Connect" version 1.3.1
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("5-anker-connect.php" instead of "anker-connect.php")

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
Good job! No executable or dangerous file extensions detected4,483 lines of code in 133 files:
LanguageFilesBlank linesComment linesLines of code
PHP746841,2353,111
JavaScript19143435930
CSS3637178183
PO File169171157
SVG101100
JSON2002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity2.95
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity1.39
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes44
▷ Abstract classes00.00%
▷ Concrete classes44100.00%
▷ Final classes12.27%
Methods219
▷ Static methods83.65%
▷ Public methods18082.19%
▷ Protected methods3415.53%
▷ Private methods52.28%
Functions38
▷ Named functions3386.84%
▷ Anonymous functions513.16%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.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.08MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/blocks/wls-search-day/anker.png27.09KB14.03KB▼ 48.23%
lib/blocks/wls-search/anker.png27.09KB14.03KB▼ 48.23%
lib/blocks/wls-search-watercamper/anker.png27.09KB14.03KB▼ 48.23%