73% wphobby-demo-import

Code Review | WPHobby Demo Import

WordPress plugin WPHobby Demo Import scored73%from 54 tests.

About plugin

  • Plugin page: wphobby-demo-import
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7
  • WordPress version: 6.3.1
  • First release: Mar 11, 2020
  • Latest release: Mar 18, 2022
  • Number of updates: 20
  • Update frequency: every 36.9 days
  • Top authors: darell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /773 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲5.10MB] [CPU: ▲27.80ms] 75% from 4 tests

This is a short check of server-side resources used by WPHobby Demo Import
Please fix the following
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.10MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.68 ▲5.2168.19 ▲31.37
Dashboard /wp-admin8.70 ▲5.3575.89 ▲13.20
Posts /wp-admin/edit.php8.70 ▲5.3477.39 ▲26.41
Add New Post /wp-admin/post-new.php10.40 ▲4.51138.29 ▲40.74
Media Library /wp-admin/upload.php8.70 ▲5.4776.83 ▲40.20
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.7064.66

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 221 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-posts
widget_recent-comments
fs_active_plugins
fs_gdpr
theysaidso_admin_options
fs_accounts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
fs_debug_mode
...

Browser metrics Passed 4 tests

WPHobby Demo Import: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲9814.77 ▲0.162.20 ▲0.5526.88 ▼15.18
Dashboard /wp-admin2,265 ▲885.65 ▼0.0190.24 ▲4.5942.17 ▼0.78
Posts /wp-admin/edit.php2,187 ▲902.51 ▲0.4943.84 ▲2.2740.71 ▲3.38
Add New Post /wp-admin/post-new.php1,583 ▲5722.91 ▼0.20588.08 ▼16.8833.22 ▼33.50
Media Library /wp-admin/upload.php1,479 ▲854.48 ▲0.3298.85 ▼1.5045.30 ▲3.81
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,1241.9928.9527.13

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/wphobby-demo-import/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 11 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • fs_gdpr
    • whdi_recent_import_log_file
    • fs_active_plugins
    • widget_recent-posts
    • db_upgraded
    • fs_accounts
    • widget_recent-comments
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 16× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Async_Request' not found in wp-content/plugins/wphobby-demo-import/includes/importers/batch-processing/helpers/class-wp-background-process.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wphobby-demo-import/includes/admin/sections/general/addons.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/wphobby-demo-import/includes/admin/sections/general/filter.php:8
    • > PHP Warning
      Use of undefined constant WHDI_DIR - assumed 'WHDI_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wphobby-demo-import/includes/compatibility/class-whdi-compatibility.php on line 47
    • > PHP Fatal error
      require_once(): Failed opening required 'WHDI_DIRincludes/compatibility/elementor/class-whdi-compatibility-elementor.php' (include_path='.:/usr/share/php') in wp-content/plugins/wphobby-demo-import/includes/compatibility/class-whdi-compatibility.php on line 47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wphobby-demo-import/includes/importers/class-whdi-helper.php:46
    • > PHP Warning
      require_once(WHDI_DIRincludes/compatibility/elementor/class-whdi-compatibility-elementor.php): failed to open stream: No such file or directory in wp-content/plugins/wphobby-demo-import/includes/compatibility/class-whdi-compatibility.php on line 47
    • > PHP Warning
      require_once(ABSPATHwp-includes/class-wp-customize-setting.php): failed to open stream: No such file or directory in wp-content/plugins/wphobby-demo-import/includes/importers/class-whdi-customizer-option.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'WHDI_Addons_List' not found in wp-content/plugins/wphobby-demo-import/includes/admin/sections/addons/list.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/image.php): failed to open stream: No such file or directory in wp-content/plugins/wphobby-demo-import/includes/importers/batch-processing/class-whdi-batch-processing.php on line 59

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 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #2, #3, #3, #4, #4, #5, #5, #6, #6, #7 in wphobby-demo-import/assets to your readme.txt
You can look at the official readme.txt

wphobby-demo-import/wphobby-demo-import.php Passed 13 tests

Analyzing the main PHP file in "WPHobby Demo Import" version 1.1.2
38 characters long description:
Demo Import Plugin for WPHobby Themes.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin36,776 lines of code in 159 files:
LanguageFilesBlank linesComment linesLines of code
PHP1368,41718,34134,403
JavaScript63393261,179
CSS1311233775
Markdown1680214
SVG213178
JSON10027

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity68.32
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.51
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes68
▷ Abstract classes45.88%
▷ Concrete classes6494.12%
▷ Final classes11.56%
Methods1,338
▷ Static methods22216.59%
▷ Public methods93369.73%
▷ Protected methods685.08%
▷ Private methods33725.19%
Functions95
▷ Named functions95100.00%
▷ Anonymous functions00.00%
Constants130
▷ Global constants10379.23%
▷ Class constants2720.77%
▷ Public constants27100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.09MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/addons/minimal.png0.14KB0.13KB▼ 3.50%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/images/play-button.png13.39KB10.70KB▼ 20.12%
assets/images/file.png5.09KB3.92KB▼ 22.99%
includes/admin/images/icon.png19.99KB0.88KB▼ 95.61%