84% site-demo

Code Review | Site Demo Creator

WordPress plugin Site Demo Creator scored84%from 54 tests.

About plugin

  • Plugin page: site-demo
  • Plugin version: 0.0.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.8
  • WordPress version: 6.3.1
  • First release: Sep 9, 2021
  • Latest release: Sep 9, 2021
  • Number of updates: 6
  • Update frequency: every 1.0 days
  • Top authors: gelform (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /819 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼9.13ms] Passed 4 tests

Server-side resources used by Site Demo Creator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.34 ▼3.16
Dashboard /wp-admin3.32 ▼0.0346.19 ▼14.49
Posts /wp-admin/edit.php3.37 ▲0.0145.75 ▼1.50
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.21 ▼17.37
Media Library /wp-admin/upload.php3.24 ▲0.0135.76 ▲0.45

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Site Demo Creator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲9214.45 ▲0.162.64 ▲0.7939.39 ▼2.13
Dashboard /wp-admin2,224 ▲384.84 ▼0.04109.66 ▼3.5038.93 ▼4.49
Posts /wp-admin/edit.php2,110 ▲212.05 ▲0.0139.53 ▲3.4634.56 ▼3.62
Add New Post /wp-admin/post-new.php1,557 ▲2918.16 ▼0.07632.85 ▲22.2464.46 ▲15.59
Media Library /wp-admin/upload.php1,409 ▲184.24 ▲0.0299.15 ▼1.8341.31 ▼3.94

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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 | 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 fix the following
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/site-demo/site-demo.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/site-demo/templates/mobile.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/site-demo/templates/browser.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/site-demo/templates/partials/menu.php:86

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: walk-through, presentation, screenshot, screencast, dmeo

site-demo/site-demo.php Passed 13 tests

The main PHP script in "Site Demo Creator" version 0.0.1 is automatically included on every request by WordPress
127 characters long description:
Demo your website in a browser or mobile mockup and capture screencasts and screenshots for explainer videos and walk-throughs.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected425 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP47736425

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods114.29%
▷ Public methods571.43%
▷ Protected methods00.00%
▷ Private methods228.57%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin