78% demopress

Code Review | DemoPress

WordPress plugin DemoPress scored78%from 54 tests.

About plugin

  • Plugin page: demopress
  • Plugin version: 1.6.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2
  • WordPress version: 6.3.1
  • First release: Nov 17, 2020
  • Latest release: Mar 29, 2023
  • Number of updates: 23
  • Update frequency: every 37.5 days
  • Top authors: GDragoN (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /1,945 total downloads

Benchmarks

Plugin footprint 82% 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.75MB] [CPU: ▲0.43ms] 75% from 4 tests

A check of server-side resources used by DemoPress
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,074.71ms on /wp-admin/options-general.php?page=demopress)
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.6047.26 ▲5.00
Dashboard /wp-admin4.14 ▲0.8455.29 ▲3.90
Posts /wp-admin/edit.php4.19 ▲0.8456.29 ▲7.32
Add New Post /wp-admin/post-new.php6.66 ▲0.7892.60 ▼14.51
Media Library /wp-admin/upload.php4.00 ▲0.7847.12 ▲10.94
DemoPress /wp-admin/options-general.php?page=demopress4.241,074.71

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 395 new files
Database: no new tables, 11 new options
New WordPress options
db_upgraded
dev4press_demopress_info
widget_theysaidso_widget
can_compress_scripts
dev4press_demopress_ctrl
dev4press_demopress_core
widget_recent-posts
theysaidso_admin_options
dev4press_demopress_task
dev4press_demopress_settings
...

Browser metrics Passed 4 tests

A check of browser resources used by DemoPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.67 ▼0.911.80 ▼0.2840.36 ▼1.99
Dashboard /wp-admin2,207 ▲225.83 ▼0.08100.05 ▼8.4443.14 ▼0.93
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0037.03 ▼5.8433.54 ▼4.22
Add New Post /wp-admin/post-new.php1,522 ▼1123.41 ▲0.21693.16 ▲13.2159.06 ▼4.94
Media Library /wp-admin/upload.php1,392 ▲44.20 ▼0.01110.62 ▼1.6249.77 ▲1.52
DemoPress /wp-admin/options-general.php?page=demopress9641.9227.4551.26

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 11 options in the database
    • dev4press_demopress_settings
    • dev4press_demopress_task
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • dev4press_demopress_ctrl
    • can_compress_scripts
    • dev4press_demopress_core
    • widget_theysaidso_widget
    • dev4press_demopress_info
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/demopress/d4plib/forms/footer.php
    • > /wp-content/plugins/demopress/forms/content-about-whatsnew.php
    • > /wp-content/plugins/demopress/d4plib/forms/content-dashboard.php
  • 47× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/demopress/forms/generators/posts.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/demopress/forms/generators/bbpress.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Dev4Press\\v35\\Functions\\panel() in wp-content/plugins/demopress/forms/sidebar-dashboard.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Dev4Press\\v35\\Functions\\panel() in wp-content/plugins/demopress/d4plib/forms/sidebar-settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/demopress/forms/content-tools-cleanup.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/demopress/forms/content-tools-export.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/demopress/forms/generators/comments.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/demopress/d4plib/forms/widget-loader.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Dev4Press\\v35\\Functions\\panel() in wp-content/plugins/demopress/d4plib/forms/content-settings-full.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function demopress_settings() in wp-content/plugins/demopress/forms/content-install.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4, #5, #6, #7, #8, #9 in demopress/assets to your readme.txt
You can take inspiration from this readme.txt

demopress/demopress.php 92% from 13 tests

The primary PHP file in "DemoPress" version 1.6.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 164 characters long)

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
There were no executable files found in this plugin124,077 lines of code in 359 files:
LanguageFilesBlank linesComment linesLines of code
JSON20094,295
PHP2084,5741,77516,033
CSS421,071407,230
Sass4385934,002
JavaScript592331211,957
SVG100528
Markdown420032

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity11.45
▷ Minimum class complexity1.00
▷ Maximum class complexity140.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces49
Interfaces0
Traits4
Classes141
▷ Abstract classes4229.79%
▷ Concrete classes9970.21%
▷ Final classes22.02%
Methods970
▷ Static methods707.22%
▷ Public methods69271.34%
▷ Protected methods22923.61%
▷ Private methods495.05%
Functions137
▷ Named functions13699.27%
▷ Anonymous functions10.73%
Constants67
▷ Global constants2131.34%
▷ Class constants4668.66%
▷ Public constants46100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
d4plib/resources/css/flags/flags.png80.58KB26.01KB▼ 67.72%