84% tinymce-pre-button

Code Review | TinyMCE Pre Button

WordPress plugin TinyMCE Pre Button scored84%from 54 tests.

About plugin

  • Plugin page: tinymce-pre-button
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.1
  • WordPress version: 6.3.1
  • First release: Mar 26, 2015
  • Latest release: Mar 26, 2015
  • Number of updates: 6
  • Update frequency: every 0.7 days
  • Top authors: mortalis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,895 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
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.77ms] Passed 4 tests

A check of server-side resources used by TinyMCE Pre Button
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.39 ▲1.39
Dashboard /wp-admin3.31 ▲0.0145.63 ▼7.00
Posts /wp-admin/edit.php3.36 ▲0.0144.57 ▼1.08
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.80 ▼17.70
Media Library /wp-admin/upload.php3.23 ▲0.0133.43 ▼1.31

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for TinyMCE Pre Button
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.75 ▼0.711.74 ▲0.0347.99 ▲2.72
Dashboard /wp-admin2,203 ▲154.84 ▼0.11105.20 ▼4.0040.26 ▼2.84
Posts /wp-admin/edit.php2,086 ▼32.01 ▼0.0333.49 ▼2.8034.75 ▲0.86
Add New Post /wp-admin/post-new.php1,533 ▼823.31 ▲5.13668.62 ▲15.9657.11 ▲10.66
Media Library /wp-admin/upload.php1,391 ▲64.20 ▼0.0198.97 ▼5.0343.88 ▲2.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tinymce-pre-button/tinymce-pre-button.php:28

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: button, shortcut, formatting, editor, tinymce

tinymce-pre-button/tinymce-pre-button.php Passed 13 tests

The main PHP script in "TinyMCE Pre Button" version 1.0 is automatically included on every request by WordPress
102 characters long description:
Adds the Pre button to the TinyMCE toolbar and the shortcut Ctrl+0 to format text with <pre> tag

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 plugin30 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript15916
PHP131114

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
mce-pre/pre.png0.14KB0.11KB▼ 22.38%