72% stm-gallery

Code Review | STM Gallery 1.9

WordPress plugin STM Gallery 1.9 scored72%from 54 tests.

About plugin

  • Plugin page: stm-gallery
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.1-4.7
  • WordPress version: 6.3.1
  • First release: Nov 27, 2016
  • Latest release: Jan 7, 2017
  • Number of updates: 18
  • Update frequency: every 2.4 days
  • Top authors: sergiotoca (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,638 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.20ms] Passed 4 tests

This is a short check of server-side resources used by STM Gallery 1.9
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0836.74 ▲1.04
Dashboard /wp-admin3.37 ▲0.0342.92 ▼13.34
Posts /wp-admin/edit.php3.42 ▲0.0745.55 ▲0.13
Add New Post /wp-admin/post-new.php5.95 ▲0.0787.61 ▼0.61
Media Library /wp-admin/upload.php3.29 ▲0.0734.58 ▲1.88
Compositions /wp-admin/edit-tags.php?taxonomy=stmpili_txn&post_type=attachment3.2930.52

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for STM Gallery 1.9
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲14213.78 ▼0.5913.56 ▲11.8842.95 ▲4.00
Dashboard /wp-admin2,203 ▲285.76 ▲0.0997.24 ▼5.3038.42 ▼4.81
Posts /wp-admin/edit.php2,114 ▲142.12 ▲0.1444.84 ▲9.4635.28 ▲1.55
Add New Post /wp-admin/post-new.php1,536 ▲1022.44 ▼0.62664.42 ▼6.6852.97 ▼0.75
Media Library /wp-admin/upload.php1,408 ▲84.39 ▲0.21100.24 ▼8.3443.40 ▼2.14
Compositions /wp-admin/edit-tags.php?taxonomy=stmpili_txn&post_type=attachment1,3482.0034.7231.20

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/edit-tags.php?taxonomy=stmpili_txn&post_type=attachment
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/stm-gallery/stmgallery_v.0.9.php+613
    Undefined index: ancho
    • > GET request to /wp-admin/edit-tags.php?taxonomy=stmpili_txn&post_type=attachment
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/stm-gallery/stmgallery_v.0.9.php+615
    Undefined index: termino
    • > GET request to /wp-admin/edit-tags.php?taxonomy=stmpili_txn&post_type=attachment
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/stm-gallery/stmgallery_v.0.9.php+755
    Undefined variable: composicion
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=stmpili_txn&post_type=attachment
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/stm-gallery/stmgallery_v.0.9.php+1614
    Trying to get property 'term_id' of non-object
    • > GET request to /wp-admin/edit-tags.php?taxonomy=stmpili_txn&post_type=attachment
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/stm-gallery/stmgallery_v.0.9.php+960
    count(): Parameter must be an array or an object that implements Countable
  • 165 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=stmpili_txn&post_type=attachment
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/stm-gallery/stmgallery_v.0.9.php+1071
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/edit-tags.php?taxonomy=stmpili_txn&post_type=attachment
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/stm-gallery/stmgallery_v.0.9.php+1451
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/edit-tags.php?taxonomy=stmpili_txn&post_type=attachment
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/stm-gallery/stmgallery_v.0.9.php+1636
    Undefined variable: stmpili_filas

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/stm-gallery/taxonomy-stmgallery.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/stm-gallery/stmgallery_v.0.9.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/stm-gallery/stmgallery_v.1.9.php:63

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/edit-tags.php?taxonomy=stmpili_txn&post_type=attachment
    • > Network (severe)
    wp-admin/admin-ajax.php - Failed to load resource: the server responded with a status of 400 (Bad Request)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Please describe screenshot #0 in stm-gallery/assets to your readme.txt
  • Screenshots: Add an image for screenshot #8 (List and manager of images of a composition.)
Please take inspiration from this readme.txt

stm-gallery/stmgallery_v.0.9.php 85% from 13 tests

The main PHP script in "STM Gallery 1.9" version 0.9 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("stm-gallery.php" instead of "stmgallery_v.0.9.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin3,453 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP38023692,774
PO File31691,031399
JavaScript4179136
CSS31629128
SVG14016

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
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%
Functions77
▷ Named functions77100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin