10% enable-latex

Code Review | Enable Latex

WordPress plugin Enable Latex scored 10% from 54 tests.

About plugin

  • Plugin page: enable-latex
  • Plugin version: 1.2.16
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5
  • WordPress version: 6.3.1
  • First release: Jul 7, 2011
  • Latest release: Apr 17, 2016
  • Number of updates: 79
  • Update frequency: every 22.1 days
  • Top authors: sedLex (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 7,916 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
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/enable-latex/core.class.php+1698
    Methods with the same name as their class will not be constructors in a future version of PHP; coreSLframework has a deprecated constructor

Server metrics [RAM: ▼1.32MB] [CPU: ▼50.42ms] Passed 4 tests

This is a short check of server-side resources used by Enable Latex
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.66 ▼0.807.51 ▼37.24
Dashboard /wp-admin2.68 ▼0.627.82 ▼41.41
Posts /wp-admin/edit.php2.68 ▼0.678.02 ▼39.87
Add New Post /wp-admin/post-new.php2.68 ▼3.206.87 ▼83.15
Media Library /wp-admin/upload.php2.68 ▼0.559.46 ▼24.89

Server storage [IO: ▲1.69MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • Illegal file modification found: 3 files (0.30KB) outside of "wp-content/plugins/enable-latex/" and "wp-content/uploads/"
    • (new file) wp-content/sedlex/inline_styles/f1e09167eaf7ffd160b6a2a067da0ec51e77ea1e.css
    • (new file) wp-content/sedlex/inline_styles/dafff9e6eed64c15b82c7f22de7e5814319b6b5f.css
    • (new file) wp-content/sedlex/inline_scripts/.empty
Filesystem: 166 new files
Database: no new tables, 9 new options
New WordPress options
coreSLframework_options
can_compress_scripts
enableLatex_options
widget_recent-comments
plugin_error_on_activation
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Enable Latex
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.31 ▼1.231.89 ▼0.4944.14 ▲1.78
Dashboard /wp-admin2,233 ▲455.83 ▲0.96103.76 ▼10.8839.17 ▼7.31
Posts /wp-admin/edit.php2,119 ▲302.02 ▼0.0239.51 ▲3.8135.26 ▲1.46
Add New Post /wp-admin/post-new.php1,542 ▲423.44 ▲0.32696.10 ▲74.9472.01 ▲11.13
Media Library /wp-admin/upload.php1,415 ▲274.20 ▲0.0597.03 ▼1.0941.67 ▼2.57
About... /wp-admin/sedlex.php260.440.0813.39
Enable Latex /wp-admin/sedlex.php?page=enable-latex/enable-latex.php260.440.098.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/enable-latex/core.class.php+1698
    Methods with the same name as their class will not be constructors in a future version of PHP; coreSLframework has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • coreSLframework_options
    • plugin_error_on_activation
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/enable-latex/enable-latex.php
    • > /wp-content/plugins/enable-latex/core.class.php
    • > /wp-content/plugins/enable-latex/core.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      require_once(): Failed opening required 'core.php' (include_path='.:/usr/share/php') in wp-content/plugins/enable-latex/core/templates/my-plugin.php on line 18
    • > PHP Warning
      require_once(core.php): failed to open stream: No such file or directory in wp-content/plugins/enable-latex/core/templates/my-plugin.php on line 18

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/sedlex.php
    • > Network (severe)
    wp-admin/sedlex.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/sedlex.php?page=enable-latex/enable-latex.php
    • > Network (severe)
    wp-admin/sedlex.php?page=enable-latex/enable-latex.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (The configuration page of the plugin), #2 (An example of LaTex formula in a post)
You can look at the official readme.txt

enable-latex/enable-latex.php 92% from 13 tests

The main PHP script in "Enable Latex" version 1.2.16 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 519 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected16,621 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
PO File353,90108,553
PHP199001,6606,664
JavaScript6219254829
CSS118513460
Markdown120084
JSON10029
INI2002

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 119)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity48.84
▷ Minimum class complexity1.00
▷ Maximum class complexity211.00
Average method complexity7.23
▷ Minimum method complexity1.00
▷ Maximum method complexity119.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes15.26%
▷ Concrete classes1894.74%
▷ Final classes00.00%
Methods146
▷ Static methods3523.97%
▷ Public methods14397.95%
▷ Protected methods32.05%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
34 PNG files occupy 0.30MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/img/tree_vline.png0.12KB0.08KB▼ 32.52%
core/img/tree_lastnode_plus.png0.14KB0.12KB▼ 14.97%
core/img/warning.png4.46KB1.51KB▼ 66.10%
core/img/arrow_up.png0.24KB0.27KB0.00%
core/img/arrow_down_s.png0.27KB0.27KB▼ 1.79%