73% mathematica-toolbox

Code Review | Mathematica Toolbox

WordPress plugin Mathematica Toolbox scored73%from 54 tests.

About plugin

  • Plugin page: mathematica-toolbox
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.8
  • WordPress version: 6.3.1
  • First release: Jul 10, 2015
  • Latest release: Oct 27, 2018
  • Number of updates: 23
  • Update frequency: every 52.7 days
  • Top authors: C. E. (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /1,812 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.44ms] Passed 4 tests

This is a short check of server-side resources used by Mathematica Toolbox
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.09 ▼5.70
Dashboard /wp-admin3.33 ▲0.0350.15 ▼0.22
Posts /wp-admin/edit.php3.38 ▲0.0252.99 ▲5.48
Add New Post /wp-admin/post-new.php5.94 ▲0.0597.51 ▼7.19
Media Library /wp-admin/upload.php3.25 ▲0.0240.94 ▲3.34

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Mathematica Toolbox: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,960 ▲19915.19 ▲0.6115.49 ▲13.6540.86 ▼6.01
Dashboard /wp-admin2,225 ▲255.86 ▲0.99114.77 ▲8.3646.60 ▲6.86
Posts /wp-admin/edit.php2,104 ▲72.00 ▼0.1740.50 ▲4.0033.89 ▼3.62
Add New Post /wp-admin/post-new.php6,308 ▲4,78225.83 ▲8.01933.52 ▲235.7563.17 ▲4.59
Media Library /wp-admin/upload.php1,404 ▲74.28 ▲0.07105.54 ▲2.0747.23 ▲0.27

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/mathematica-toolbox/public/Mathematica-WP-Toolbox-API.php+135
    Invalid argument supplied for foreach()
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • mma_transient_keys
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Mathematica_WP_Toolbox_API' not found in wp-content/plugins/mathematica-toolbox/public/Mathematica-WP-Toolbox-API-general.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Mathematica_WP_Toolbox_API' not found in wp-content/plugins/mathematica-toolbox/public/Mathematica-WP-Toolbox-API-user.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === mathematica-toolbox === )
  • Donate link: Invalid url: ""
You can look at the official readme.txt

mathematica-toolbox/Mathematica-Toolbox.php 85% from 13 tests

The main PHP file in "Mathematica Toolbox" ver. 1.0.4 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 301 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("mathematica-toolbox.php" instead of "Mathematica-Toolbox.php")

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
Good job! No executable or dangerous file extensions detected1,324 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP112826661,057
JavaScript65729180
CSS417987

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity8.44
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity1.34
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods41
▷ Static methods12.44%
▷ Public methods3278.05%
▷ Protected methods49.76%
▷ Private methods512.20%
Functions16
▷ Named functions212.50%
▷ Anonymous functions1487.50%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/images/default.png6.54KB3.25KB▼ 50.31%