78% wp-mathjax-plus

Code Review | WP MathJax

WordPress plugin WP MathJax scored78%from 54 tests.

About plugin

  • Plugin page: wp-mathjax-plus
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.3.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 9, 2020
  • Latest release: May 29, 2023
  • Number of updates: 4
  • Update frequency: every 272.8 days
  • Top authors: terrylin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /1,784 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.34ms] Passed 4 tests

Analyzing server-side resources used by WP MathJax
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.91 ▼3.02
Dashboard /wp-admin3.36 ▲0.0651.63 ▲1.38
Posts /wp-admin/edit.php3.48 ▲0.1253.15 ▼3.11
Add New Post /wp-admin/post-new.php5.97 ▲0.0891.64 ▼20.59
Media Library /wp-admin/upload.php3.29 ▲0.0640.45 ▲4.10

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 794 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

WP MathJax: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲5913.81 ▼0.612.23 ▼0.0441.54 ▼0.91
Dashboard /wp-admin2,233 ▲425.63 ▲0.79123.64 ▲13.8539.20 ▼1.19
Posts /wp-admin/edit.php2,122 ▲332.43 ▲0.3759.52 ▲18.2133.94 ▼2.87
Add New Post /wp-admin/post-new.php6,262 ▲4,74021.17 ▼1.84959.29 ▲289.1339.25 ▼24.20
Media Library /wp-admin/upload.php1,418 ▲304.73 ▲0.55117.48 ▲7.1044.16 ▼0.47
WP MathJax /wp-admin/wp-mathjax.php260.440.0915.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mathjax-plus/inc/admin/setting.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mathjax-plus/inc/smart-loader.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mathjax-plus/inc/admin/menu.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mathjax-plus/inc/shortcode.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mathjax-plus/inc/block.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-mathjax-plus/inc/admin/register.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mathjax-plus/inc/mathjax-js.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/wp-mathjax.php
    • > Network (severe)
    wp-admin/wp-mathjax.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: katex, mathjax, latex, asciimath

wp-mathjax-plus/wp-mathjax.php 85% from 13 tests

Analyzing the main PHP file in "WP MathJax" version 1.0.1
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 ("wp-mathjax-plus.php" instead of "wp-mathjax.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 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin8,328 lines of code in 782 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript76597015,0907,564
PHP13104251542
PO File38184207
CSS14815

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.21MB with 0.14MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/example-gutenberg-block-1.png65.72KB24.38KB▼ 62.90%
assets/example-gutenberg-block-4.png51.96KB18.77KB▼ 63.87%
assets/example-gutenberg-block-3.png56.68KB19.85KB▼ 64.98%
assets/example-gutenberg-block-2.png44.31KB16.65KB▼ 62.43%