79% demo-content-templates

Code Review | Demo Content Templates

WordPress plugin Demo Content Templates scored79%from 54 tests.

About plugin

  • Plugin page: demo-content-temp...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Jan 12, 2018
  • Latest release: Feb 21, 2018
  • Number of updates: 13
  • Update frequency: every 3.2 days
  • Top authors: pmac8 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /804 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.35MB] [CPU: ▼4.79ms] Passed 4 tests

A check of server-side resources used by Demo Content Templates
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3740.43 ▲3.09
Dashboard /wp-admin3.67 ▲0.3246.95 ▼13.00
Posts /wp-admin/edit.php3.72 ▲0.3644.28 ▼2.83
Add New Post /wp-admin/post-new.php6.25 ▲0.3692.32 ▼2.89
Media Library /wp-admin/upload.php3.59 ▲0.3635.71 ▼0.44
Demo Template Settings /wp-admin/tools.php?page=dct_admin3.5233.84
Add New /wp-admin/post-new.php?post_type=dct_template3.7558.27
Demo Templates /wp-admin/edit.php?post_type=dct_template3.6438.34

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 64 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Demo Content Templates
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.71 ▲0.331.76 ▲0.1649.82 ▲8.01
Dashboard /wp-admin2,220 ▲465.55 ▼0.0285.37 ▼1.9839.38 ▲2.52
Posts /wp-admin/edit.php2,131 ▲342.02 ▼0.0133.05 ▼4.6335.05 ▲1.11
Add New Post /wp-admin/post-new.php1,563 ▲3518.27 ▼4.78596.68 ▼46.1865.61 ▲13.75
Media Library /wp-admin/upload.php1,434 ▲314.20 ▲0.03104.24 ▲5.6044.32 ▼2.91
Demo Template Settings /wp-admin/tools.php?page=dct_admin9002.0322.8936.22
Add New /wp-admin/post-new.php?post_type=dct_template2,8207.77174.0869.55
Demo Templates /wp-admin/edit.php?post_type=dct_template1,1461.9729.9929.94

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/demo-content-templates/src/View/templates/dct_template_dropdown.php
    • > /wp-content/plugins/demo-content-templates/src/View/templates/dct_metabox.php
  • 18× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: page_template_options in wp-content/plugins/demo-content-templates/src/View/templates/dct_template_dropdown.php on line 3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/demo-content-templates/src/View/templates/dct_metabox.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/demo-content-templates/tests/Infrastructure/test-WP_Page_Duplicator.php:12
    • > PHP Notice
      Undefined variable: key in wp-content/plugins/demo-content-templates/tests/test-data/templates/test-template.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/demo-content-templates/tests/Domain/ValueObjects/test-Labels.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PMac\\DemoContentTemplates\\plugin_dir_path() in wp-content/plugins/demo-content-templates/demo-content-templates.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Page' not found in wp-content/plugins/demo-content-templates/src/Infrastructure/Walker_Page_Checkbox.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/demo-content-templates/tests/Domain/ValueObjects/test-AdminSubMenu.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Assert\\InvalidArgumentException' not found in wp-content/plugins/demo-content-templates/vendor/beberlei/assert/lib/Assert/LazyAssertionException.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/demo-content-templates/tests/Infrastructure/test-WP_Template_Locator.php:7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: theme content, demo content, page template

demo-content-templates/demo-content-templates.php Passed 13 tests

The main PHP script in "Demo Content Templates" version 1.0 is automatically included on every request by WordPress
38 characters long description:
Store demo page content for later use.

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
There were no executable files found in this plugin3,444 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
PHP497802,3733,112
JSON300126
Bourne Shell12111120
CSS291039
XML24231
Markdown15016

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity11.46
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces8
Interfaces1
Traits0
Classes36
▷ Abstract classes12.78%
▷ Concrete classes3597.22%
▷ Final classes00.00%
Methods251
▷ Static methods9638.25%
▷ Public methods23493.23%
▷ Protected methods135.18%
▷ Private methods41.59%
Functions17
▷ Named functions1376.47%
▷ Anonymous functions423.53%
Constants72
▷ Global constants00.00%
▷ Class constants72100.00%
▷ Public constants72100.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
There were not PNG files found in your plugin