84% tinymce-code-formatting

Code Review | TinyMCE Code Formatting

WordPress plugin TinyMCE Code Formatting scored84%from 54 tests.

About plugin

  • Plugin page: tinymce-code-form...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.1
  • WordPress version: 6.3.1
  • First release: Apr 7, 2015
  • Latest release: Apr 14, 2015
  • Number of updates: 15
  • Update frequency: every 0.5 days
  • Top authors: mortalis (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /3,243 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.29ms] Passed 4 tests

An overview of server-side resources used by TinyMCE Code Formatting
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.86 ▼0.15
Dashboard /wp-admin3.33 ▲0.0246.28 ▼3.25
Posts /wp-admin/edit.php3.38 ▲0.0246.38 ▼0.76
Add New Post /wp-admin/post-new.php5.93 ▲0.0491.49 ▼5.00
Media Library /wp-admin/upload.php3.25 ▲0.0235.48 ▲0.69
TinyMCE Code Formatting /wp-admin/options-general.php?page=mce-code-formatting3.2230.31

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for TinyMCE Code Formatting
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.48 ▲0.111.92 ▼0.0341.08 ▼3.04
Dashboard /wp-admin2,210 ▲224.84 ▼0.05109.81 ▼7.1642.70 ▼2.22
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0442.64 ▲6.5936.06 ▼0.17
Add New Post /wp-admin/post-new.php1,377 ▼15616.65 ▼6.45550.38 ▼95.2742.78 ▼6.45
Media Library /wp-admin/upload.php1,392 ▲44.21 ▼0.0993.81 ▼6.6339.45 ▼2.81
TinyMCE Code Formatting /wp-admin/options-general.php?page=mce-code-formatting7982.0524.6727.30

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, 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
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tinymce-code-formatting/tinymce-code-formatting.php:61
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tinymce-code-formatting/lib/options.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: shortcut, tinymce, formatting, button, pre...

tinymce-code-formatting/tinymce-code-formatting.php Passed 13 tests

"TinyMCE Code Formatting" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
80 characters long description:
Adds the Pre and Code buttons to the TinyMCE toolbar with customizable shortcuts

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected235 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript33219137
PHP2264488
CSS12010

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
mce-pre/images/code.png0.15KB0.11KB▼ 25.00%
mce-pre/images/pre.png0.14KB0.11KB▼ 22.38%