63% nugget-by-ingot

Code Review | Nugget by Ingot: Easy, automated and native A/B testing for everyone

WordPress plugin Nugget by Ingot: Easy, automated and native A/B testing for everyone scored 63% from 54 tests.

About plugin

  • Plugin page: nugget-by-ingot
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-4.5
  • WordPress version: 5.9.2
  • First release: Mar 16, 2016
  • Latest release: Mar 16, 2016
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: Shelob9 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,013 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲1.05MB] [CPU: ▼298.11ms] Passed 4 tests

An overview of server-side resources used by Nugget by Ingot: Easy, automated and native A/B testing for everyone
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.40 ▲1.8974.00 ▲19.62
Dashboard /wp-admin5.35 ▲1.9451.93 ▲18.71
Posts /wp-admin/edit.php5.57 ▲1.9352.90 ▲11.86
Add New Post /wp-admin/post-new.php5.40 ▼1.5744.52 ▼1,235.03
Media Library /wp-admin/upload.php5.29 ▲2.0037.55 ▲12.02
Freemius Debug [v.1.1.7.3] /wp-admin/admin.php?page=freemius5.3037.43

Server storage [IO: ▲5.86MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 337 new files
Database: 4 new tables, 4 new options
New tables
wp_ingot_session
wp_ingot_group
wp_ingot_tracking
wp_ingot_variant
New WordPress options
fs_active_plugins
fs_accounts
_ingot_session_ID_last_assigned
fs_api_cache

Browser metrics Passed 4 tests

Checking browser requirements for Nugget by Ingot: Easy, automated and native A/B testing for everyone
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,958 ▲20416.05 ▲0.398.54 ▲2.322.48 ▼0.58
Dashboard /wp-admin2,938 ▲776.12 ▼0.11125.61 ▼11.35185.42 ▲20.10
Posts /wp-admin/edit.php2,734 ▲433.25 ▲0.0263.44 ▲3.09149.91 ▲10.06
Add New Post /wp-admin/post-new.php1,700 ▲1023.06 ▲2.44394.92 ▼55.37160.26 ▲1.42
Media Library /wp-admin/upload.php1,741 ▲435.56 ▲0.06141.36 ▼0.73204.31 ▲17.00
Freemius Debug [v.1.1.7.3] /wp-admin/admin.php?page=freemius1,2902.5754.34133.14

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/nugget-by-ingot/vendor/freemius/wordpress-sdk/includes/class-freemius.php+3212
    First parameter must either be an object or the name of an existing class
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_ingot_tracking
    • wp_ingot_session
    • wp_ingot_group
    • wp_ingot_variant
  • The uninstall procedure has failed, leaving 4 options in the database
    • fs_accounts
    • fs_api_cache
    • fs_active_plugins
    • _ingot_session_ID_last_assigned

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)
Even though no errors were found, this is by no means 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
Please fix the following
  • 37× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ingot\\testing\\crud\\crud' not found in wp-content/plugins/nugget-by-ingot/vendor/ingot/ingot-core/classes/testing/crud/group.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'ingot\\testing\\crud\\crud' not found in wp-content/plugins/nugget-by-ingot/vendor/ingot/ingot-core/classes/testing/crud/variant.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'MaBandit\\Strategy\\Strategy' not found in wp-content/plugins/nugget-by-ingot/vendor/ingot/mabandit/src/MaBandit/Strategy/EpsilonGreedy.php:5
    • > PHP Warning
      require(wp-content/plugins/nugget-by-ingot/vendor/ingot/mabandit/vendor/nikic/php-parser/lib/bootstrap.php): failed to open stream: No such file or directory in wp-content/plugins/nugget-by-ingot/vendor/ingot/mabandit/vendor/composer/autoload_real.php on line 58
    • > PHP Fatal error
      Uncaught Error: Class 'ingot\\testing\\cookies\\cookie' not found in wp-content/plugins/nugget-by-ingot/vendor/ingot/ingot-core/classes/testing/cookies/user.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'ingot\\testing\\cookies\\cookie' not found in wp-content/plugins/nugget-by-ingot/vendor/ingot/ingot-core/classes/testing/cookies/price.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'ingot\\testing\\api\\rest\\route' not found in wp-content/plugins/nugget-by-ingot/vendor/ingot/ingot-core/classes/testing/api/rest/variant.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'ingot\\testing\\tests\\price\\price' not found in wp-content/plugins/nugget-by-ingot/vendor/ingot/ingot-core/classes/testing/tests/price/plugins/edd.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'ingot\\licensing\\license' not found in wp-content/plugins/nugget-by-ingot/vendor/ingot/ingot-core/classes/licensing/freemius.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'ingot\\testing\\bandit\\bandit' not found in wp-content/plugins/nugget-by-ingot/vendor/ingot/ingot-core/classes/testing/bandit/content.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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
Attributes that need to be fixed:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

nugget-by-ingot/ingot-nugget.php 85% from 13 tests

"Nugget by Ingot: Easy, automated and native A/B testing for everyone" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("nugget-by-ingot.php" instead of "ingot-nugget.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
No dangerous file extensions were detected60,213 lines of code in 292 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript327,12122,16132,443
PHP1845,34415,60820,079
CSS18219662,519
JSON13001,856
Sass12216781,319
SVG100655
Markdown111900623
HTML15286595
XML55085
LESS161139

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity18.99
▷ Minimum class complexity1.00
▷ Maximum class complexity758.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces30
Interfaces1
Traits0
Classes135
▷ Abstract classes107.41%
▷ Concrete classes12592.59%
▷ Final classes00.00%
Methods1,282
▷ Static methods37729.41%
▷ Public methods91271.14%
▷ Protected methods18914.74%
▷ Private methods18114.12%
Functions126
▷ Named functions10381.75%
▷ Anonymous functions2318.25%
Constants88
▷ Global constants8293.18%
▷ Class constants66.82%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
22 PNG files occupy 0.16MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/ingot/ingot-core/assets/img/ingot-logo-s.png8.54KB2.80KB▼ 67.20%
vendor/ingot/ingot-core/assets/admin/css/images/ui-bg_diagonals-thick_20_666666_40x40.png0.34KB0.15KB▼ 55.27%
vendor/ingot/ingot-core/assets/admin/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png0.31KB0.14KB▼ 54.26%
vendor/ingot/ingot-core/assets/admin/css/images/ui-icons_ef8c08_256x240.png4.49KB4.18KB▼ 6.89%
vendor/ingot/ingot-core/assets/admin/css/images/ui-bg_glass_100_f6f6f6_1x400.png0.29KB0.12KB▼ 59.47%