77% ample-themes-demo-importer

Code Review | Ample Themes Demo Importer

WordPress plugin Ample Themes Demo Importer scored77%from 54 tests.

About plugin

  • Plugin page: ample-themes-demo...
  • Plugin version: 2.4.0 * Author: amp...
  • PHP compatiblity: 5.3.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5
  • WordPress version: 6.3.1
  • First release: Dec 24, 2019
  • Latest release: Jul 3, 2021
  • Number of updates: 43
  • Update frequency: every 13.1 days
  • Top authors: amplethemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /63,224 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.00MB] [CPU: ▼7.78ms] Passed 4 tests

Analyzing server-side resources used by Ample Themes Demo Importer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0134.46 ▼6.54
Dashboard /wp-admin3.31 ▲0.0043.98 ▼4.67
Posts /wp-admin/edit.php3.36 ▲0.0047.18 ▼1.19
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.77 ▼18.72
Media Library /wp-admin/upload.php3.23 ▲0.0035.18 ▼0.44

Server storage [IO: ▲85.54MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
It is recommended to fix the following issues
  • Filesystem usage must be lower than 25MB (currently using 85.54MB)
Filesystem: 242 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ample Themes Demo Importer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.45 ▲0.071.57 ▼0.3942.65 ▲1.89
Dashboard /wp-admin2,203 ▲125.91 ▲0.07107.99 ▲5.0643.04 ▼3.54
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0039.57 ▼1.0134.78 ▼1.63
Add New Post /wp-admin/post-new.php1,544 ▲1623.41 ▲5.16653.84 ▲49.0750.44 ▼2.46
Media Library /wp-admin/upload.php1,388 ▼34.20 ▼0.0095.50 ▼8.3540.34 ▼4.89

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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 items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/ample-themes-demo-importer/ample-themes-demo-site-importer.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      require_once(): Failed opening required 'ATDI_PATHinc/aidi-advanced-import.php' (include_path='.:/usr/share/php') in wp-content/plugins/ample-themes-demo-importer/inc/class-atdi-main.php on line 47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ample-themes-demo-importer/inc/amplethemes/advanced-import.php:945
    • > PHP Warning
      Use of undefined constant ATDI_PATH - assumed 'ATDI_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ample-themes-demo-importer/inc/class-atdi-main.php on line 47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ample-themes-demo-importer/inc/a2zthemes/advanced-import.php:572
    • > PHP Warning
      require_once(ATDI_PATHinc/aidi-advanced-import.php): failed to open stream: No such file or directory in wp-content/plugins/ample-themes-demo-importer/inc/class-atdi-main.php on line 47

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)
There were no browser issues found

Optimizations

Plugin configuration 86% 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: Screenshot #1 (Plugin Page) image not found
Please take inspiration from this readme.txt

ample-themes-demo-importer/ample-themes-demo-site-importer.php 77% from 13 tests

The main PHP file in "Ample Themes Demo Importer" ver. 2.4.0 * Author: amp... adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ample-themes-demo-importer.php" instead of "ample-themes-demo-site-importer.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Version: The version number should only use digits and periods (ex. "1.0.3" instead of "2.4.0 * Author: amp...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected2,040 lines of code in 178 files:
LanguageFilesBlank linesComment linesLines of code
PHP5199401,623
JSON17100338
CSS15056
JavaScript15523

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity17.00
▷ Minimum class complexity4.00
▷ Maximum class complexity30.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods216.67%
▷ Public methods1083.33%
▷ Protected methods00.00%
▷ Private methods216.67%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
29 PNG files occupy 27.63MB with 18.74MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/amplethemes/ample-magazine/demo-7/demo-7.png916.15KB320.45KB▼ 65.02%
inc/amplethemes/ample-magazine-pro/demo-8/demo-8.png795.12KB277.21KB▼ 65.14%
inc/amplethemes/ours-restaurant-pro/demo-2/screenshot.png1,096.49KB344.53KB▼ 68.58%
inc/amplethemes/news-bulletin/demo1/screenshot.png1,095.03KB334.99KB▼ 69.41%
inc/amplethemes/ample-magazine/demo-9/demo-9.png1,241.30KB361.24KB▼ 70.90%