84% demonstrator

Code Review | Demonstrator

WordPress plugin Demonstrator scored 84% from 54 tests.

About plugin

  • Plugin page: demonstrator
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.6
  • WordPress version: 6.3.1
  • First release: Jul 19, 2017
  • Latest release: Jul 5, 2018
  • Number of updates: 15
  • Update frequency: every 23.5 days
  • Top authors: _smartik_ (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,341 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▲1.05ms] Passed 4 tests

An overview of server-side resources used by Demonstrator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2647.68 ▲6.62
Dashboard /wp-admin3.59 ▲0.2960.81 ▲10.73
Posts /wp-admin/edit.php3.64 ▲0.2851.14 ▲3.61
Add New Post /wp-admin/post-new.php6.11 ▲0.2286.85 ▼13.45
Media Library /wp-admin/upload.php3.45 ▲0.2239.69 ▲7.41
Demonstrator /wp-admin/admin.php?page=demonstrator_settings3.6345.86
Themes Demo /wp-admin/admin.php?page=demonstrator_instance_themes3.5947.54

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 93 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
demonstrator_instance_themes
demonstrator_settings
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Demonstrator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲10413.21 ▼1.175.33 ▲3.7242.98 ▼5.20
Dashboard /wp-admin2,239 ▲514.85 ▼0.05103.01 ▼3.8640.03 ▲0.98
Posts /wp-admin/edit.php2,122 ▲332.00 ▼0.0234.81 ▼2.5330.27 ▼3.74
Add New Post /wp-admin/post-new.php1,575 ▲4118.20 ▼4.98600.74 ▼26.5071.64 ▲16.59
Media Library /wp-admin/upload.php1,421 ▲334.23 ▲0.02100.37 ▼5.7242.09 ▼0.91
Demonstrator /wp-admin/admin.php?page=demonstrator_settings1,6083.5154.24100.70
Themes Demo /wp-admin/admin.php?page=demonstrator_instance_themes1,7813.5057.5083.16

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • demonstrator_instance_themes
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • demonstrator_settings
    • db_upgraded

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
Please take a closer look at the following
  • 29× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include_once(DEMONSTRATOR_PATHautoloader.php): failed to open stream: No such file or directory in wp-content/plugins/demonstrator/plugin.php on line 90
    • > PHP Fatal error
      require_once(): Failed opening required 'DEMONSTRATOR_PATHwarnings/abstract-warning.php' (include_path='.:/usr/share/php') in wp-content/plugins/demonstrator/warnings/php-warning.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/demonstrator/components/Activate/component.php:56
    • > PHP Fatal error
      Uncaught Error: Class 'Demonstrator\\Assets\\Manage' not found in wp-content/plugins/demonstrator/plugin.php:93
    • > PHP Fatal error
      Uncaught Error: Class 'Demonstrator\\AbstractFieldType' not found in wp-content/plugins/demonstrator/engine/FieldInfoField.class.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Demonstrator\\AbstractFieldType' not found in wp-content/plugins/demonstrator/engine/FieldPageSelect.class.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Demonstrator\\AbstractFieldType' not found in wp-content/plugins/demonstrator/engine/FieldImage.class.php:5
    • > PHP Warning
      require_once(DEMONSTRATOR_PATHwarnings/abstract-warning.php): failed to open stream: No such file or directory in wp-content/plugins/demonstrator/warnings/php-warning.php on line 2
    • > PHP Warning
      require_once(DEMONSTRATOR_PATHwarnings/abstract-warning.php): failed to open stream: No such file or directory in wp-content/plugins/demonstrator/warnings/noplugin-warning.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Demonstrator\\AbstractFieldType' not found in wp-content/plugins/demonstrator/engine/FieldRadio.class.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4 in demonstrator/assets to your readme.txt
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === demonstrator === )
You can look at the official readme.txt

demonstrator/demonstrator.php Passed 13 tests

This is the main PHP file of "Demonstrator" version 1.3.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
27 characters long description:
More than a theme switcher!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin9,144 lines of code in 79 files:
LanguageFilesBlank linesComment linesLines of code
LESS83192832,337
PHP366594302,099
CSS83041731,623
JavaScript113362521,099
XML1000907
HTML2974650
SVG103248
Sass1230110
Markdown123060
JSON10011

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity8.55
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes29
▷ Abstract classes26.90%
▷ Concrete classes2793.10%
▷ Final classes27.41%
Methods154
▷ Static methods10.65%
▷ Public methods14996.75%
▷ Protected methods53.25%
▷ Private methods00.00%
Functions10
▷ Named functions770.00%
▷ Anonymous functions330.00%
Constants7
▷ Global constants7100.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/github.png0.55KB0.54KB▼ 1.25%
assets/img/happy.png2.70KB2.18KB▼ 19.33%
assets/img/code.png0.91KB0.88KB▼ 2.91%