78% calculoid-calculators-builder

Code Review | Calculoid - Calculator builder

WordPress plugin Calculoid - Calculator builder scored78%from 54 tests.

About plugin

  • Plugin page: calculoid-calcula...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.3.2
  • WordPress version: 6.3.1
  • First release: May 16, 2014
  • Latest release: Feb 17, 2020
  • Number of updates: 28
  • Update frequency: every 75.1 days
  • Top authors: calculoid (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /6,199 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
Installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼2.37ms] Passed 4 tests

A check of server-side resources used by Calculoid - Calculator builder
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1244.90 ▼4.50
Dashboard /wp-admin3.52 ▲0.2159.45 ▲1.71
Posts /wp-admin/edit.php3.56 ▲0.2162.60 ▲10.42
Add New Post /wp-admin/post-new.php6.03 ▲0.1498.74 ▼5.82
Media Library /wp-admin/upload.php3.35 ▲0.1239.30 ▼0.87
Calculoid Admin /wp-admin/options-general.php?page=calc-admin3.3637.14

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Calculoid - Calculator builder
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,967 ▲20615.27 ▲0.921.73 ▲0.0445.41 ▼1.57
Dashboard /wp-admin2,373 ▲1996.61 ▲0.93121.80 ▲22.5636.84 ▼12.33
Posts /wp-admin/edit.php2,304 ▲2043.37 ▲1.3648.63 ▲9.9732.30 ▼5.77
Add New Post /wp-admin/post-new.php1,558 ▲3223.11 ▼0.36626.01 ▼67.5235.38 ▼21.01
Media Library /wp-admin/upload.php1,441 ▲414.49 ▲0.2296.67 ▼16.8043.39 ▼2.89
Calculoid Admin /wp-admin/options-general.php?page=calc-admin1,1203.6749.9564.92

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

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
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/calculoid-calculators-builder/post-meta-manager-api/fields/radio_buttons.php
    • > /wp-content/plugins/calculoid-calculators-builder/post-meta-manager-api/fields/delimiter.php
  • 45× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: saved_value in wp-content/plugins/calculoid-calculators-builder/post-meta-manager-api/fields/custom_featured_stack.php on line 370
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/calculoid-calculators-builder/index.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PostMetaManagerFieldType' not found in wp-content/plugins/calculoid-calculators-builder/post-meta-manager-api/tmp/metabox.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/calculoid-calculators-builder/post-meta-manager-api/fields/wp_editor.php:15
    • > PHP Notice
      Undefined variable: saved_value in wp-content/plugins/calculoid-calculators-builder/post-meta-manager-api/fields/reviews.php on line 352
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/calculoid-calculators-builder/post-meta-manager-api/fields/reviews.php:68
    • > PHP Notice
      Undefined variable: identifier in wp-content/plugins/calculoid-calculators-builder/post-meta-manager-api/fields/i_was_wearing.php on line 382
    • > PHP Notice
      Undefined variable: identifier in wp-content/plugins/calculoid-calculators-builder/post-meta-manager-api/fields/similar_items.php on line 368
    • > PHP Notice
      Undefined variable: field_data in wp-content/plugins/calculoid-calculators-builder/post-meta-manager-api/fields/radio_buttons.php on line 2
    • > PHP Notice
      Undefined variable: identifier in wp-content/plugins/calculoid-calculators-builder/post-meta-manager-api/fields/video_gallery.php on line 380

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

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
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === calculoid-calculators-builder === )
The official readme.txt is a good inspiration

calculoid-calculators-builder/index.php 92% from 13 tests

This is the main PHP file of "Calculoid - Calculator builder" version 1.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
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 ("calculoid-calculators-builder.php" instead of "index.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
Success! There were no dangerous files found in this plugin5,259 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP272142012,543
JavaScript44211981,550
CSS348561,166

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.72
Average class complexity22.40
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods45
▷ Static methods12.22%
▷ Public methods4497.78%
▷ Protected methods00.00%
▷ Private methods12.22%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants33
▷ Global constants824.24%
▷ Class constants2575.76%
▷ Public constants25100.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
16 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
post-meta-manager-api/css/images/ui-bg_highlight-soft_50_aaaaaa_1x100.png0.27KB0.18KB▼ 33.57%
post-meta-manager-api/css/images/ui-icons_ededed_256x240.png6.75KB4.17KB▼ 38.19%
post-meta-manager-api/css/images/ui-icons_ffcf29_256x240.png4.44KB4.17KB▼ 6.02%
post-meta-manager-api/css/images/ui-bg_glass_40_111111_1x400.png0.25KB0.16KB▼ 36.92%
post-meta-manager-api/css/images/ui-bg_flat_8_333333_40x100.png0.21KB0.08KB▼ 60.45%