68% embed-sweethome3d

Code Review | SweetHome3D-Embed

WordPress plugin SweetHome3D-Embed scored68%from 54 tests.

About plugin

  • Plugin page: embed-sweethome3d
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Jan 7, 2019
  • Latest release: Jan 8, 2019
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: stevecohenfr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /743 total downloads

Benchmarks

Plugin footprint 65% 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: ▲1.55MB] [CPU: ▲24.19ms] Passed 4 tests

Server-side resources used by SweetHome3D-Embed
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.6140.48 ▼3.03
Dashboard /wp-admin5.28 ▲1.9784.75 ▲26.67
Posts /wp-admin/edit.php5.35 ▲1.9982.96 ▲35.77
Add New Post /wp-admin/post-new.php7.53 ▲1.64133.93 ▲37.41
Media Library /wp-admin/upload.php5.28 ▲2.0572.71 ▲37.34

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 36 new files
Database: 1 new table, 7 new options
New tables
wp_sh3dembed
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
sh3dembed_db_version

Browser metrics Passed 4 tests

SweetHome3D-Embed: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,941 ▲18414.73 ▲0.3614.41 ▲12.2342.88 ▼6.31
Dashboard /wp-admin2,223 ▲354.86 ▼1.04128.28 ▲14.7042.85 ▼0.63
Posts /wp-admin/edit.php2,133 ▲442.77 ▲0.7149.64 ▲14.8029.74 ▼8.04
Add New Post /wp-admin/post-new.php1,530 ▲1623.20 ▲5.53623.94 ▼66.27109.76 ▲60.46
Media Library /wp-admin/upload.php1,417 ▲294.77 ▲0.57120.84 ▲19.3041.25 ▼5.48

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie tables were found after uninstall: 1 table
    • wp_sh3dembed
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • sh3dembed_db_version
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

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 | 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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/embed-sweethome3d/public/partials/sweethome3dembed-public-display.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/embed-sweethome3d/admin/partials/sweethome3dembed-admin-display-table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function submit_button() in wp-content/plugins/embed-sweethome3d/admin/partials/sweethome3dembed-admin-display.php:10
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/embed-sweethome3d/admin/partials/sweethome3dembed-admin-display-table.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/embed-sweethome3d/admin/partials/sweethome3dembed-admin-display-table.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The admin interface), #2 (Result of embed house in an article)
You can look at the official readme.txt

embed-sweethome3d/sweethome3dembed.php 92% from 13 tests

The main PHP file in "SweetHome3D-Embed" ver. 1.0.1 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 ("embed-sweethome3d.php" instead of "sweethome3dembed.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin552 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP14218615487
JavaScript101116955
CSS22810

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity3.44
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.42
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods53
▷ Static methods713.21%
▷ Public methods4788.68%
▷ Protected methods00.00%
▷ Private methods611.32%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.82MB with 0.51MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/js/lib/navigationPanel.png4.63KB2.65KB▼ 42.79%
assets/screenshot-1.png164.87KB48.44KB▼ 70.62%
assets/screenshot-2.png674.37KB235.38KB▼ 65.10%
public/js/lib/close.png0.58KB0.17KB▼ 70.69%