78% gm-import

Code Review | Gearment Import Flatsome

WordPress plugin Gearment Import Flatsome scored78%from 54 tests.

About plugin

  • Plugin page: gm-import
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2
  • WordPress version: 6.3.1
  • First release: Mar 25, 2020
  • Latest release: May 20, 2020
  • Number of updates: 19
  • Update frequency: every 3.0 days
  • Top authors: truonglong (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,184 total downloads

Benchmarks

Plugin footprint 83% 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: ▼0.12MB] [CPU: ▼13.26ms] Passed 4 tests

A check of server-side resources used by Gearment Import Flatsome
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5944.90 ▲3.67
Dashboard /wp-admin3.91 ▲0.6151.35 ▼1.94
Posts /wp-admin/edit.php3.95 ▲0.5948.79 ▼1.14
Add New Post /wp-admin/post-new.php3.68 ▼2.2137.94 ▼53.37
Media Library /wp-admin/upload.php3.79 ▲0.5640.26 ▲3.43
Gearment Import /wp-admin/options-general.php?page=gm-import3.7536.14

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 152 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Gearment Import Flatsome
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲17213.56 ▼0.829.18 ▲7.3643.12 ▼2.86
Dashboard /wp-admin2,214 ▲266.08 ▲0.27112.22 ▼2.6742.89 ▼3.13
Posts /wp-admin/edit.php2,100 ▲112.06 ▲0.0335.57 ▼1.4734.58 ▼1.93
Add New Post /wp-admin/post-new.php1,524 ▲1023.65 ▲6.11681.52 ▼6.0559.46 ▲9.65
Media Library /wp-admin/upload.php1,396 ▲84.19 ▼0.0997.53 ▼4.5141.92 ▼1.48
Gearment Import /wp-admin/options-general.php?page=gm-import8702.0325.6231.14

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • 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)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/gm-import/public/partials/gm-import-public-display.php
  • 67× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/gm-import/includes/attachment.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Box\\Spout\\Writer\\AbstractWriter' not found in wp-content/plugins/gm-import/admin/partials/spout-master/src/Spout/Writer/CSV/Writer.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/gm-import/admin/partials/gm-import-page-settings.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Box\\Spout\\Common\\Escaper\\EscaperInterface' not found in wp-content/plugins/gm-import/admin/partials/spout-master/src/Spout/Common/Escaper/XLSX.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Box\\Spout\\Reader\\IteratorInterface' not found in wp-content/plugins/gm-import/admin/partials/spout-master/src/Spout/Reader/CSV/SheetIterator.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Box\\Spout\\Reader\\Exception\\ReaderException' not found in wp-content/plugins/gm-import/admin/partials/spout-master/src/Spout/Reader/Exception/ReaderNotOpenedException.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Box\\Spout\\Reader\\IteratorInterface' not found in wp-content/plugins/gm-import/admin/partials/spout-master/src/Spout/Reader/ODS/RowIterator.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/gm-import/includes/thumbnail.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Box\\Spout\\Reader\\AbstractReader' not found in wp-content/plugins/gm-import/admin/partials/spout-master/src/Spout/Reader/XLSX/Reader.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Box\\Spout\\Reader\\AbstractReader' not found in wp-content/plugins/gm-import/admin/partials/spout-master/src/Spout/Reader/CSV/Reader.php:14

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

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: gearment, import, swatch, color

gm-import/gm-import.php 85% from 13 tests

"Gearment Import Flatsome" version 2.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • 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
  • Description: Please keep the plugin description shorter than 140 characters (currently 221 characters long)

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
There were no executable files found in this plugin9,620 lines of code in 137 files:
LanguageFilesBlank linesComment linesLines of code
PHP1252,3985,4578,589
JavaScript4149140704
CSS3258237
JSON11041
Markdown124039
HTML32010

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.32
▷ Minimum class complexity1.00
▷ Maximum class complexity243.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity61.00
Code structure
Namespaces29
Interfaces8
Traits2
Classes95
▷ Abstract classes99.47%
▷ Concrete classes8690.53%
▷ Final classes00.00%
Methods642
▷ Static methods304.67%
▷ Public methods40863.55%
▷ Protected methods20231.46%
▷ Private methods324.98%
Functions93
▷ Named functions8894.62%
▷ Anonymous functions55.38%
Constants181
▷ Global constants73.87%
▷ Class constants17496.13%
▷ Public constants174100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
File_example.PNG10.34KB6.00KB▼ 42.01%