78% long-toolkit

Code Review | Long Toolkit

WordPress plugin Long Toolkit scored78%from 54 tests.

About plugin

  • Plugin page: long-toolkit
  • Plugin version: 2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.4
  • WordPress version: 6.3.1
  • First release: May 29, 2019
  • Latest release: Jul 3, 2020
  • Number of updates: 10
  • Update frequency: every 40.1 days
  • Top authors: longbsvnu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /706 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.76MB] [CPU: ▼1.43ms] Passed 4 tests

A check of server-side resources used by Long Toolkit
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3444.33 ▲1.10
Dashboard /wp-admin4.26 ▲0.9548.72 ▲0.22
Posts /wp-admin/edit.php4.31 ▲0.9547.89 ▲1.59
Add New Post /wp-admin/post-new.php6.78 ▲0.8884.03 ▼8.62
Media Library /wp-admin/upload.php4.12 ▲0.8838.52 ▲6.20

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Long Toolkit
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.45 ▼0.111.66 ▼0.3942.89 ▼2.00
Dashboard /wp-admin2,195 ▲215.59 ▲0.0683.63 ▼13.3639.86 ▼5.45
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0135.15 ▲0.3533.57 ▼3.73
Add New Post /wp-admin/post-new.php1,526 ▼223.16 ▲0.13675.77 ▼8.5749.90 ▼11.77
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.0395.73 ▼15.6041.33 ▼5.30

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 11× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/long-toolkit/includes/admin-fields/field_icon_picker.php
    • > /wp-content/plugins/long-toolkit/addons/importer/importer.php
    • > /wp-content/plugins/long-toolkit/includes/admin-fields/field_default.php
    • > /wp-content/plugins/long-toolkit/includes/admin-fields/field_image_picker.php
    • > /wp-content/plugins/long-toolkit/includes/admin-fields/field_autocomplete.php
    • > /wp-content/plugins/long-toolkit/includes/admin-fields/field_map.php
    • > /wp-content/plugins/long-toolkit/includes/admin-fields/field_datetime.php
    • > /wp-content/plugins/long-toolkit/includes/admin-fields/field_image_select.php
    • > /wp-content/plugins/long-toolkit/includes/admin-fields/field_repeater.php
    • > /wp-content/plugins/long-toolkit/includes/admin-fields/field_color_picker.php
  • 30× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/long-toolkit/sample/post-meta.php:584
    • > PHP Warning
      Use of undefined constant LONG_TOOLKIT_DIR - assumed 'LONG_TOOLKIT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/long-toolkit/sample/sample.php on line 15
    • > PHP Warning
      include(): Failed opening 'LONG_TOOLKIT_DIRsample/menu.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/long-toolkit/sample/sample.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/long-toolkit/sample/taxonomy.php:261
    • > PHP Warning
      include(LONG_TOOLKIT_DIRsample/post-meta.php): failed to open stream: No such file or directory in wp-content/plugins/long-toolkit/sample/sample.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/long-toolkit/sample/customizer.php:365
    • > PHP Warning
      require_once(ABSPATHwp-includes/class-wp-customize-setting.php): failed to open stream: No such file or directory in wp-content/plugins/long-toolkit/addons/importer/includes/class-importer-customize-setting.php on line 5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/long-toolkit/addons/importer/includes/class-importer-customize-setting.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/long-toolkit/addons/importer/templates/available.php:12
    • > PHP Warning
      include(LONG_TOOLKIT_DIRsample/widget.php): failed to open stream: No such file or directory in wp-content/plugins/long-toolkit/sample/sample.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Some available dummy-data options), #2 (Manually import), #3 (Metabox field), #4 (Customizer fields), #5 (Taxonomy fields), #6 (Widget fields)
The official readme.txt might help

long-toolkit/long-toolkit.php Passed 13 tests

The primary PHP file in "Long Toolkit" version 2.5 is used by WordPress to initiate all plugin functionality
98 characters long description:
Create Admin fields, metabox, widget, taxonomy, menu meta, customizer fields quickly and friendly.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected40,574 lines of code in 103 files:
LanguageFilesBlank linesComment linesLines of code
XML23053915,640
JavaScript211,6861,6608,441
PHP491,6542,2376,848
CSS192632125,169
SVG2002,690
Sass1016101,786

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity23.06
▷ Minimum class complexity1.00
▷ Maximum class complexity193.00
Average method complexity4.82
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes33
▷ Abstract classes13.03%
▷ Concrete classes3296.97%
▷ Final classes26.25%
Methods189
▷ Static methods2412.70%
▷ Public methods16386.24%
▷ Protected methods31.59%
▷ Private methods2312.17%
Functions46
▷ Named functions4393.48%
▷ Anonymous functions36.52%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.19MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
addons/importer/dummy-data/theme-unit-test/screenshot.png86.19KB37.39KB▼ 56.61%
addons/importer/assets/img/no-image-preview.png8.33KB1.87KB▼ 77.51%
assets/images/add.png0.13KB0.11KB▼ 17.91%
assets/images/select2x2.png0.83KB0.77KB▼ 6.15%
addons/importer/dummy-data/woocommerce/screenshot.png93.82KB55.26KB▼ 41.10%