78% artplacer-widget

Code Review | ArtPlacer Widget

WordPress plugin ArtPlacer Widget scored78%from 54 tests.

About plugin

  • Plugin page: artplacer-widget
  • Plugin version: 2.20.4
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Oct 27, 2020
  • Latest release: Dec 1, 2023
  • Number of updates: 164
  • Update frequency: every 7.7 days
  • Top authors: artplacer (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /6,462 total downloads

Benchmarks

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

This is a short check of server-side resources used by ArtPlacer Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1043.23 ▲0.60
Dashboard /wp-admin3.44 ▲0.0944.06 ▼19.35
Posts /wp-admin/edit.php3.53 ▲0.1847.55 ▼1.38
Add New Post /wp-admin/post-new.php6.15 ▲0.2675.18 ▼28.70
Media Library /wp-admin/upload.php3.37 ▲0.1533.19 ▼0.19
ArtPlacer /wp-admin/admin.php?page=art-placer3.3132.52
Add /wp-admin/admin.php?page=add-art-placer3.3329.70
/wp-admin/admin.php?page=edit-art-placer3.3331.73

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 27 new files
Database: 1 new table, 7 new options
New tables
wp_artplacer
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
jal_db_version

Browser metrics Passed 4 tests

A check of browser resources used by ArtPlacer Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲13614.22 ▼0.154.34 ▲2.6146.14 ▲1.06
Dashboard /wp-admin2,231 ▲635.60 ▲0.0798.29 ▲5.0978.94 ▲38.60
Posts /wp-admin/edit.php2,133 ▲331.99 ▼0.0238.52 ▲0.6833.85 ▼3.00
Add New Post /wp-admin/post-new.php1,555 ▲2923.69 ▼0.02778.43 ▲109.3057.13 ▼2.28
Media Library /wp-admin/upload.php1,427 ▲334.25 ▲0.09105.03 ▲6.1785.51 ▲44.32
ArtPlacer /wp-admin/admin.php?page=art-placer8641.539.6455.90
Add /wp-admin/admin.php?page=add-art-placer9841.358.3930.62
/wp-admin/admin.php?page=edit-art-placer9701.538.3527.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • can_compress_scripts
    • jal_db_version
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=edit-art-placer
    • > Notice in wp-content/plugins/artplacer-widget/includes/edit.php+206
    Trying to get property 'term_id' of non-object
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=edit-art-placer
    • > Notice in wp-content/plugins/artplacer-widget/includes/edit.php+216
    Trying to get property 'name' of non-object
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=edit-art-placer
    • > Notice in wp-content/plugins/artplacer-widget/includes/edit.php+190
    Undefined variable: row
    • > GET request to /wp-admin/admin.php?page=edit-art-placer
    • > Notice in wp-content/plugins/artplacer-widget/includes/edit.php+107
    Trying to get property 'code' of non-object
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=edit-art-placer
    • > Notice in wp-content/plugins/artplacer-widget/includes/edit.php+148
    Trying to get property 'position' of non-object
    • > GET request to /wp-admin/admin.php?page=edit-art-placer
    • > Notice in wp-content/plugins/artplacer-widget/includes/edit.php+190
    Trying to get property 'categories' of non-object

SRP 50% 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
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/artplacer-widget/includes/functions.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/artplacer-widget/includes/modal.php:12
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/artplacer-widget/includes/list.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/artplacer-widget/includes/edit.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/artplacer-widget/artplacer-widget.php:48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/artplacer-widget/includes/add.php:35
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/artplacer-widget/includes/edit.php on line 33
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/artplacer-widget/includes/list.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
Please take inspiration from this readme.txt

artplacer-widget/artplacer-widget.php Passed 13 tests

This is the main PHP file of "ArtPlacer Widget" version 2.20.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
57 characters long description:
Display the ArtPlacer widget into your products or posts.

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
No dangerous file extensions were detected3,349 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript49601,603
PHP6103271,195
CSS3973551

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions2896.55%
▷ Anonymous functions13.45%
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
8 PNG files occupy 1.38MB with 0.78MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/artplacer-menu-icon.png1.09KB0.29KB▼ 73.91%
assets/banner-1544x500-rtl.png508.74KB274.98KB▼ 45.95%
assets/images/logo-white.png2.33KB2.28KB▼ 2.22%
assets/images/wp-artplacer-ico.png1.02KB0.15KB▼ 85.62%
assets/icon-128x128.png1.38KB0.37KB▼ 73.25%