84% tinymce-preformatted

Code Review | TinyMCE Preformatted

WordPress plugin TinyMCE Preformatted scored 84% from 54 tests.

About plugin

  • Plugin page: tinymce-preformatted
  • Plugin version: 0.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Nov 22, 2010
  • Latest release: Jan 12, 2015
  • Number of updates: 17
  • Update frequency: every 92.8 days
  • Top authors: miyauchi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 6,034 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Analyzing server-side resources used by TinyMCE Preformatted
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.22 ▼4.62
Dashboard /wp-admin3.32 ▲0.0147.82 ▼3.76
Posts /wp-admin/edit.php3.37 ▲0.0143.63 ▼0.30
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.58 ▼8.08
Media Library /wp-admin/upload.php3.24 ▲0.0134.71 ▲0.48

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for TinyMCE Preformatted
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲9213.20 ▼1.182.00 ▲0.1442.32 ▼8.99
Dashboard /wp-admin2,208 ▲205.85 ▲0.99110.43 ▼7.8842.53 ▼3.34
Posts /wp-admin/edit.php2,094 ▲51.99 ▼0.0234.67 ▼4.0533.78 ▼1.71
Add New Post /wp-admin/post-new.php1,539 ▲1923.19 ▼0.05675.50 ▲37.5153.18 ▲4.19
Media Library /wp-admin/upload.php1,393 ▲24.16 ▼0.0393.96 ▼2.4041.38 ▼0.56

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% 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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      file_get_contents(wp-content/plugins/tinymce-preformatted/mce_plugins/3.5/plugins/preformatted/langs/_dlg.js): failed to open stream: No such file or directory in /var/www/wordpress/wp-content/plugins/tinymce-preformatted/mce_plugins/3.5/plugins/preformatted/langs/langs.php on line 4
    • > PHP Notice
      Undefined variable: mce_locale in wp-content/plugins/tinymce-preformatted/mce_plugins/3.5/plugins/preformatted/langs/langs.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/tinymce-preformatted/tinymce-preformatted.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Visual Editor.) image missing
The official readme.txt is a good inspiration

tinymce-preformatted/tinymce-preformatted.php Passed 13 tests

The entry point to "TinyMCE Preformatted" version 0.6.0 is a PHP file that has certain tags in its header comment area
27 characters long description:
Insert preformatted source.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin289 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6258145
PHP32833115
HTML12022
CSS1207

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity4.50
▷ Minimum class complexity4.00
▷ Maximum class complexity5.00
Average method complexity1.70
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ 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

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png71.93KB30.75KB▼ 57.25%
mce_plugins/3.5/plugins/preformatted/img/icon.png0.25KB0.12KB▼ 51.00%