78% just-tinymce-styles

Code Review | Just TinyMCE Custom Styles

WordPress plugin Just TinyMCE Custom Styles scored78%from 54 tests.

About plugin

  • Plugin page: just-tinymce-styles
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.5
  • WordPress version: 6.3.1
  • First release: Jul 20, 2016
  • Latest release: Aug 14, 2020
  • Number of updates: 15
  • Update frequency: every 99.1 days
  • Top authors: aprokopenko (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

2,000+ active /17,170 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼1.33ms] Passed 4 tests

A check of server-side resources used by Just TinyMCE Custom Styles
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.46 ▼2.96
Dashboard /wp-admin3.37 ▲0.0751.31 ▼0.79
Posts /wp-admin/edit.php3.48 ▲0.1349.86 ▼2.55
Add New Post /wp-admin/post-new.php6.02 ▲0.1493.68 ▲1.00
Media Library /wp-admin/upload.php3.29 ▲0.0738.79 ▲1.91
Presets /wp-admin/admin.php?page=jtmce_presets3.3235.78
TinyMCE Custom Styles /wp-admin/options-general.php?page=jtmce_formats3.3436.56
Settings /wp-admin/admin.php?page=jtmce_settings3.3536.08

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Just TinyMCE Custom Styles
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.30 ▼1.144.62 ▲2.8943.30 ▼1.18
Dashboard /wp-admin2,207 ▲225.84 ▲0.05101.37 ▼2.8039.32 ▼5.78
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0537.27 ▼5.7631.37 ▼4.61
Add New Post /wp-admin/post-new.php1,522 ▲823.05 ▲5.43644.89 ▼50.7352.83 ▼7.43
Media Library /wp-admin/upload.php1,392 ▲44.20 ▲0.0497.00 ▼22.9246.37 ▼3.15
Presets /wp-admin/admin.php?page=jtmce_presets8351.9938.6627.29
TinyMCE Custom Styles /wp-admin/options-general.php?page=jtmce_formats8111.9634.2928.10
Settings /wp-admin/admin.php?page=jtmce_settings1,0121.9528.0631.45

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/just-tinymce-styles/views/_footer.php
  • 27× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_permalink() in wp-content/plugins/just-tinymce-styles/views/presets/index.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'jtmce\\core\\Component' not found in wp-content/plugins/just-tinymce-styles/core/Controller.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'jtmce\\core\\Model' not found in wp-content/plugins/just-tinymce-styles/models/Settings.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_permalink() in wp-content/plugins/just-tinymce-styles/views/settings/index.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/just-tinymce-styles/views/_tabs.php:2
    • > PHP Warning
      include(JTMCE_ROOT/views/_header.php): failed to open stream: No such file or directory in wp-content/plugins/just-tinymce-styles/views/formats/index.php on line 8
    • > PHP Warning
      include(): Failed opening 'JTMCE_ROOT/views/_header.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/just-tinymce-styles/views/formats/index.php on line 8
    • > PHP Warning
      include(JTMCE_ROOT/views/_header.php): failed to open stream: No such file or directory in wp-content/plugins/just-tinymce-styles/views/presets/index.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'jtmce\\core\\Model' not found in wp-content/plugins/just-tinymce-styles/models/Preset.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'jtmce\\core\\Model' not found in wp-content/plugins/just-tinymce-styles/models/Formats.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Plugin settings page where you can enable/disable formatter options), #2 (Style formatters edit), #3 (Bootstrap styles preset)
You can take inspiration from this readme.txt

just-tinymce-styles/just-tiny-mce-styles.php 92% from 13 tests

The primary PHP file in "Just TinyMCE Custom Styles" version 1.2.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("just-tinymce-styles.php" instead of "just-tiny-mce-styles.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
Success! There were no dangerous files found in this plugin1,449 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP262503951,052
JSON100211
JavaScript12324100
CSS11086

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity6.71
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes17
▷ Abstract classes15.88%
▷ Concrete classes1694.12%
▷ Final classes00.00%
Methods68
▷ Static methods1116.18%
▷ Public methods6392.65%
▷ Protected methods34.41%
▷ Private methods22.94%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants19.09%
▷ Class constants1090.91%
▷ Public constants10100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.51MB with 0.37MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png211.57KB62.91KB▼ 70.26%
screenshot-2.png57.42KB12.94KB▼ 77.46%
screenshot-3.png109.44KB31.74KB▼ 71.00%
screenshot-1.png146.39KB45.96KB▼ 68.61%