84% advanced-custom-fields-number-slider

Code Review | Advanced Custom Fields: Number Slider

WordPress plugin Advanced Custom Fields: Number Slider scored84%from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 0.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.8.2
  • WordPress version: 6.3.1
  • First release: Jan 2, 2014
  • Latest release: Oct 21, 2022
  • Number of updates: 29
  • Update frequency: every 110.8 days
  • Top authors: qlstudio (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

700+ active /10,779 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.34ms] Passed 4 tests

Server-side resources used by Advanced Custom Fields: Number Slider
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.41 ▼5.06
Dashboard /wp-admin3.31 ▲0.0149.95 ▼5.37
Posts /wp-admin/edit.php3.36 ▲0.0152.88 ▲0.43
Add New Post /wp-admin/post-new.php5.89 ▲0.0186.93 ▼11.37
Media Library /wp-admin/upload.php3.24 ▲0.0141.33 ▲5.61

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Custom Fields: Number Slider
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.23 ▼1.442.01 ▼0.1345.85 ▼4.42
Dashboard /wp-admin2,224 ▲215.85 ▲0.0698.91 ▼10.5942.44 ▼3.69
Posts /wp-admin/edit.php2,103 ▲31.99 ▼0.0236.11 ▼0.5437.47 ▲0.08
Add New Post /wp-admin/post-new.php1,545 ▼023.08 ▼0.00650.12 ▼44.2261.02 ▲8.79
Media Library /wp-admin/upload.php1,400 ▲34.23 ▼0.0296.30 ▼6.0545.97 ▲0.34

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
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_Field' not found in wp-content/plugins/advanced-custom-fields-number-slider/number-slider-v3.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-number-slider/number-slider-v4.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/advanced-custom-fields-number-slider/acf-number-slider.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-number-slider/number-slider-v5.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Sliding Number Selector on edit screen), #2 (Configure Number Slider Field in ACF)
The official readme.txt is a good inspiration

advanced-custom-fields-number-slider/acf-number-slider.php 92% from 13 tests

"Advanced Custom Fields: Number Slider" version 0.6.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("advanced-custom-fields-number-slider.php" instead of "acf-number-slider.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected1,119 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP4176358450
JavaScript32348366
PO File34445145
Markdown146076
CSS112049
JSON30033

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.05
Average class complexity2.50
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.22
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods27
▷ Static methods00.00%
▷ Public methods27100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png20.32KB9.22KB▼ 54.65%
screenshot-1.png19.68KB9.37KB▼ 52.40%