68% mosaic-generator

Code Review | Mosaic Generator

WordPress plugin Mosaic Generator scored68%from 54 tests.

About plugin

  • Plugin page: mosaic-generator
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.9
  • WordPress version: 6.3.1
  • First release: Aug 21, 2012
  • Latest release: Apr 21, 2014
  • Number of updates: 35
  • Update frequency: every 17.4 days
  • Top authors: odn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /5,192 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼1.93MB] [CPU: ▼60.35ms] Passed 4 tests

This is a short check of server-side resources used by Mosaic Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.395.22 ▼37.58
Dashboard /wp-admin2.09 ▼1.255.86 ▼61.24
Posts /wp-admin/edit.php2.09 ▼1.267.39 ▼39.97
Add New Post /wp-admin/post-new.php2.09 ▼3.806.37 ▼102.62
Media Library /wp-admin/upload.php2.09 ▼1.146.64 ▼27.86

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
mosaic_generator_options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Mosaic Generator: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲3513.36 ▼1.224.04 ▲1.9438.60 ▼3.35
Dashboard /wp-admin2,213 ▲255.86 ▲0.98100.75 ▼15.2439.38 ▼7.39
Posts /wp-admin/edit.php2,075 ▼142.01 ▼0.0034.97 ▼0.3435.67 ▼1.31
Add New Post /wp-admin/post-new.php1,540 ▲723.14 ▼0.14702.31 ▲25.8653.00 ▼0.09
Media Library /wp-admin/upload.php1,395 ▲104.21 ▲0.05100.68 ▼1.7944.98 ▼0.36
Mosaic Generator /wp-admin/mosaic_generator.php260.440.0913.58

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
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mosaic_generator_view_style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mosaic-generator/mosaic_generator.php:33

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/mosaic_generator.php
    • > Network (severe)
    wp-admin/mosaic_generator.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: header, mosaic, head, logo, image...

mosaic-generator/mosaic_generator.php 92% from 13 tests

This is the main PHP file of "Mosaic Generator" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mosaic-generator.php" instead of "mosaic_generator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,268 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2206481,213
CSS29555

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity155.00
▷ Minimum class complexity155.00
▷ Maximum class complexity155.00
Average method complexity7.16
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods2496.00%
▷ Protected methods00.00%
▷ Private methods14.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin