78% postmagthemes-demo-import

Code Review | PostmagThemes Demo Import

WordPress plugin PostmagThemes Demo Import scored78%from 54 tests.

About plugin

  • Plugin page: postmagthemes-dem...
  • Plugin version: 1.0.9
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Oct 26, 2019
  • Latest release: Jun 12, 2023
  • Number of updates: 13
  • Update frequency: every 102.1 days
  • Top authors: postmagthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /9,836 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼7.70ms] Passed 4 tests

This is a short check of server-side resources used by PostmagThemes Demo Import
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0432.89 ▼6.52
Dashboard /wp-admin3.35 ▲0.0445.12 ▼5.29
Posts /wp-admin/edit.php3.46 ▲0.1043.83 ▼4.40
Add New Post /wp-admin/post-new.php5.93 ▲0.0481.64 ▼14.58
Media Library /wp-admin/upload.php3.27 ▲0.0432.95 ▼1.50
Import Demo Data /wp-admin/themes.php?page=pt-one-click-demo-import3.3332.90

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for PostmagThemes Demo Import
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.34 ▼0.031.62 ▼0.0435.66 ▼7.58
Dashboard /wp-admin2,199 ▲225.49 ▼0.0981.53 ▼17.6540.61 ▼3.86
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0334.03 ▼2.5534.35 ▲2.79
Add New Post /wp-admin/post-new.php1,540 ▲1418.63 ▼4.48639.27 ▲19.3272.40 ▲28.36
Media Library /wp-admin/upload.php1,404 ▲44.18 ▼0.00101.24 ▲2.7939.65 ▼4.70
Import Demo Data /wp-admin/themes.php?page=pt-one-click-demo-import9272.0137.9761.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/postmagthemes-demo-import/postmagthemes-demo-import.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/postmagthemes-demo-import/views/plugin-page.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Setting' not found in wp-content/plugins/postmagthemes-demo-import/inc/CustomizerOption.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PostmagThemes\\WPContentImporter2\\WXRImporter' not found in wp-content/plugins/postmagthemes-demo-import/inc/WXRImporter.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PostmagThemes\\WPContentImporter2\\WPImporterLoggerCLI' not found in wp-content/plugins/postmagthemes-demo-import/inc/Logger.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PostmagThemes\\WPContentImporter2\\WPImporterLogger' not found in wp-content/plugins/postmagthemes-demo-import/vendor/postmagthemes/wp-content-importer-v2/src/WPImporterLoggerCLI.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/postmagthemes-demo-import/inc/WPCLICommands.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Importer' not found in wp-content/plugins/postmagthemes-demo-import/vendor/postmagthemes/wp-content-importer-v2/src/WXRImporter.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_theme() in wp-content/plugins/postmagthemes-demo-import/demo/demo.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention: The official readme.txt might help

postmagthemes-demo-import/postmagthemes-demo-import.php 92% from 13 tests

Analyzing the main PHP file in "PostmagThemes Demo Import" version 1.0.9
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin4,443 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity29.25
▷ Minimum class complexity1.00
▷ Maximum class complexity287.00
Average method complexity4.17
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes15.00%
▷ Static methods3620.34%
▷ Public methods11564.97%
▷ Protected methods3620.34%
▷ Private methods2614.69%
▷ Named functions125.00%
▷ Anonymous functions375.00%
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.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
There are no PNG files in this plugin