10% wpmathpub

Code Review | WP Math Publisher - wpmathpub

WordPress plugin WP Math Publisher - wpmathpub scored 10% from 54 tests.

About plugin

  • Plugin page: wpmathpub
  • Plugin version: 2.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.3-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 28, 2008
  • Latest release: Nov 22, 2022
  • Number of updates: 49
  • Update frequency: every 109.3 days
  • Top authors: ronf (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active / 19,933 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wpmathpub/wpmathpub.php+66
    define(): Declaration of case-insensitive constants is deprecated

Server metrics [RAM: ▼1.87MB] [CPU: ▼54.14ms] Passed 4 tests

This is a short check of server-side resources used by WP Math Publisher - wpmathpub
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.354.59 ▼44.23
Dashboard /wp-admin2.13 ▼1.176.60 ▼42.12
Posts /wp-admin/edit.php2.13 ▼1.226.07 ▼41.54
Add New Post /wp-admin/post-new.php2.13 ▼3.755.66 ▼88.68
Media Library /wp-admin/upload.php2.13 ▼1.106.12 ▼28.89
wpmathpub /wp-admin/tools.php?page=wpmathpubmanage2.136.52

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 158 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WP Math Publisher - wpmathpub
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.18 ▼1.201.54 ▼0.7238.89 ▼14.97
Dashboard /wp-admin2,210 ▲194.84 ▼0.01110.84 ▲5.5742.53 ▲1.76
Posts /wp-admin/edit.php2,090 ▼22.06 ▲0.0340.42 ▼2.1735.07 ▼0.57
Add New Post /wp-admin/post-new.php1,537 ▲123.08 ▼0.43591.20 ▼42.6055.30 ▲9.22
Media Library /wp-admin/upload.php1,395 ▲104.23 ▼0.0696.91 ▼2.3239.88 ▼3.75
wpmathpub /wp-admin/tools.php?page=wpmathpubmanage8662.0123.4928.10

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/wpmathpub/wpmathpub.php+66
    define(): Declaration of case-insensitive constants is deprecated
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/tools.php?page=wpmathpubmanage
    • > Deprecated in wp-content/plugins/wpmathpub/wpmathpub.php+66
    define(): Declaration of case-insensitive constants is deprecated
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=wpmathpubmanage
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wpmathpub/phpmathpublisher/fonts/index.php
    • > /wp-content/plugins/wpmathpub/phpmathpublisher/doc/index.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/wpmathpub/wpmathpub.php:79

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (WordPress post with [pmath] tags mixed with plain text), #2 (WordPress comments with [pmath] tags mixed with plain text (as shown from WP v:2.5.1 admin tool's detail view)), #3 (WordPress plugin management page after upload and activation), #4 (Sample directory structure of this plugin within a WordPress installation), #5 (status display from the author's blog > Manage > wpmathpub menu)
  • Tags: Too many tags (24 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

wpmathpub/wpmathpub.php 92% from 13 tests

The main PHP file in "WP Math Publisher - wpmathpub" ver. 2.0.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 383 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,333 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP31181951,654
HTML4450574
CSS182105

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity28.67
▷ Minimum class complexity1.00
▷ Maximum class complexity84.00
Average method complexity4.19
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
128 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
phpmathpublisher/doc/sample.png1.82KB1.63KB▼ 10.15%
phpmathpublisher/doc/img/e6dd33685d13dc7a5f7291114512fafc.png0.16KB0.15KB▼ 0.63%
phpmathpublisher/doc/img/6b5c2ab858733a005ad3f8c858d2c0be.png0.21KB0.21KB0.47%
phpmathpublisher/doc/img/bd58d2042db2d48bbc8e1dfa882d2e7d.png0.17KB0.17KB0.00%
phpmathpublisher/doc/img/math_994_105138a1af0cc9a8aede73b2549168e4.png0.29KB0.27KB▼ 7.64%