78% elegant-themes-demo-importer

Code Review | Elegant Blog Themes Demo Importer

WordPress plugin Elegant Blog Themes Demo Importer scored78%from 54 tests.

About plugin

  • Plugin page: elegant-themes-de...
  • Plugin version: 1.0.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8.2
  • WordPress version: 6.3.1
  • First release: Jul 20, 2021
  • Latest release: May 11, 2022
  • Number of updates: 20
  • Update frequency: every 15.0 days
  • Top authors: elegantblgthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /10,489 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.85ms] Passed 4 tests

Analyzing server-side resources used by Elegant Blog Themes Demo Importer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.66 ▼8.07
Dashboard /wp-admin3.32 ▲0.0150.49 ▼4.08
Posts /wp-admin/edit.php3.37 ▲0.0152.74 ▼0.50
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.34 ▼18.75
Media Library /wp-admin/upload.php3.24 ▲0.0138.85 ▲3.41

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 58 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Elegant Blog Themes Demo Importer: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,879 ▲11813.47 ▼1.127.60 ▲5.8942.51 ▼2.82
Dashboard /wp-admin2,202 ▲255.55 ▼0.0385.85 ▼17.4640.45 ▼5.26
Posts /wp-admin/edit.php2,107 ▲102.00 ▲0.0440.60 ▲4.1234.58 ▼1.29
Add New Post /wp-admin/post-new.php1,536 ▲123.27 ▲4.94658.57 ▲4.7953.41 ▼12.20
Media Library /wp-admin/upload.php1,407 ▲44.15 ▼0.05100.22 ▼4.6142.39 ▲1.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

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 | 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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/elegant-themes-demo-importer/admin/partials/elegant-demo-importer-admin-display.php
    • > /wp-content/plugins/elegant-themes-demo-importer/public/partials/elegant-demo-importer-public-display.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/elegant-themes-demo-importer/includes/class-elegant-demo-importer.php:311

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Donate link: Invalid URI found ("")
Please take inspiration from this readme.txt

elegant-themes-demo-importer/elegant-demo-importer.php 85% from 13 tests

The main PHP script in "Elegant Blog Themes Demo Importer" version 1.0.7 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("elegant-themes-demo-importer.php" instead of "elegant-demo-importer.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin97,326 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
XML81,19834497,046
PHP12133537274
JavaScript24546
CSS2080

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 compressed PNG files occupy 2.17MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/messina.png194.60KB196.75KB0.00%
public/img/food.png363.79KB380.02KB0.00%
public/img/zion.png376.22KB384.03KB0.00%
public/img/vinyl.png292.06KB298.29KB0.00%
public/img/travel.png211.13KB214.66KB0.00%