93% reusable-contents

Code Review | Reusable Contents

WordPress plugin Reusable Contents scored 93% from 54 tests.

About plugin

  • Plugin page: reusable-contents
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0+
  • WordPress version: 5.8.1
  • First release: Nov 30, 2012
  • Latest release: Dec 1, 2012
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: egza (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,134 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼136.53ms] Passed 4 tests

This is a short check of server-side resources used by Reusable Contents
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0435.98 ▲2.77
Dashboard /wp-admin3.11 ▲0.0536.94 ▲3.76
Posts /wp-admin/edit.php3.16 ▲0.0545.98 ▲3.08
Add New Post /wp-admin/post-new.php5.47 ▲0.0388.14 ▼554.07
Media Library /wp-admin/upload.php3.05 ▲0.0431.95 ▲2.10
Add New /wp-admin/post-new.php?post_type=reusable_contents3.1546.41
All Reusable Contents /wp-admin/edit.php?post_type=reusable_contents3.0936.08

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Reusable Contents
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,709 ▲11315.89 ▲0.2510.69 ▼0.8651.52 ▲6.31
Dashboard /wp-admin2,993 ▲595.91 ▼0.28137.00 ▼10.57140.01 ▲28.98
Posts /wp-admin/edit.php2,787 ▲482.72 ▼0.1263.54 ▲5.0091.03 ▲3.99
Add New Post /wp-admin/post-new.php1,696 ▲8118.95 ▼2.52373.58 ▲99.37109.31 ▲5.49
Media Library /wp-admin/upload.php1,781 ▼265.02 ▼0.01129.06 ▼22.55145.20 ▲32.98
Add New /wp-admin/post-new.php?post_type=reusable_contents2,8578.91212.77165.82
All Reusable Contents /wp-admin/edit.php?post_type=reusable_contents1,4532.6159.1973.92

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/reusable-contents/reusable-contents.php:18
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/reusable-contents/reusable-contents.php on line 18

User-side errors Passed 1 test

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


Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Create "Reusable Content" using Wordpress admin editor.), #2 (For every "Reusable Content" there is a shortcode.), #3 (Generated shortcodes can be used in posts, pages, widgets.), #4 ("Reusable Content" is displayed on the post.), #5 ("Reusable Content" can be used in a text widget.)
  • Tested up to: Invalid plugin version format
You can take inspiration from this readme.txt

reusable-contents/reusable-contents.php 92% from 13 tests

The primary PHP file in "Reusable Contents" version 0.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 182 characters long)

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 plugin184 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PO File2285292

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.44
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ Global constants00.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
6 compressed PNG files occupy 0.17MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/reusable_contents.png1.59KB0.98KB▼ 38.34%
screenshot-2.png17.01KB16.17KB▼ 4.95%
screenshot-1.png45.87KB44.65KB▼ 2.65%
screenshot-4.png57.81KB56.95KB▼ 1.48%
screenshot-5.png29.97KB29.29KB▼ 2.27%