78% editor-templates

Code Review | Editor Templates

WordPress plugin Editor Templates scored78%from 54 tests.

About plugin

  • Plugin page: editor-templates
  • Plugin version: 0.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.1
  • WordPress version: 6.3.1
  • First release: Feb 2, 2012
  • Latest release: May 30, 2013
  • Number of updates: 25
  • Update frequency: every 19.4 days
  • Top authors: jim912 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /10,433 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.15MB] [CPU: ▼11.01ms] Passed 4 tests

A check of server-side resources used by Editor Templates
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1541.46 ▼0.96
Dashboard /wp-admin3.47 ▲0.1248.78 ▼21.50
Posts /wp-admin/edit.php3.58 ▲0.2349.71 ▲0.92
Add New Post /wp-admin/post-new.php6.05 ▲0.1788.51 ▼22.51
Media Library /wp-admin/upload.php3.39 ▲0.1639.93 ▲1.98

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Editor Templates
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.23 ▼0.954.65 ▲2.7043.80 ▲0.51
Dashboard /wp-admin2,204 ▲165.83 ▼0.08100.03 ▼5.5440.03 ▼3.86
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0438.35 ▲2.2233.17 ▲0.78
Add New Post /wp-admin/post-new.php1,533 ▲1323.45 ▲0.30690.25 ▲3.4257.32 ▼6.13
Media Library /wp-admin/upload.php1,395 ▲74.24 ▲0.11103.75 ▼9.3645.06 ▼2.81
Editor Templates /wp-admin/editor-templates.php260.440.1015.37

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function tpl_post_thumbnail() in wp-content/plugins/editor-templates/template-sample/post.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/editor-templates/editor-templates.php:26

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/editor-templates.php
    • > Network (severe)
    wp-admin/editor-templates.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Sample edit page - title, category, excerpt, post-thumbnail), #2 (Sample edit page - custom fields), #3 (Sample template source)
You can look at the official readme.txt

editor-templates/editor-templates.php Passed 13 tests

"Editor Templates" version 0.1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
78 characters long description:
投稿タイプ毎に専用の投稿テンプレートを作成できます。

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
Good job! No executable or dangerous file extensions detected985 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP311713699
CSS3360160
JavaScript1181093
PO File16633

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity83.00
▷ Minimum class complexity83.00
▷ Maximum class complexity83.00
Average method complexity5.56
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/default.png1.63KB0.70KB▼ 57.02%
screenshot-3.png14.17KB13.09KB▼ 7.60%
screenshot-1.png11.83KB10.69KB▼ 9.69%
screenshot-2.png12.14KB11.08KB▼ 8.68%