79% motivation-generator

Code Review | Motivation Generator

WordPress plugin Motivation Generator scored79%from 54 tests.

About plugin

  • Plugin page: motivation-generator
  • Plugin version: 2.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9
  • WordPress version: 6.3.1
  • First release: Sep 20, 2013
  • Latest release: Apr 22, 2014
  • Number of updates: 26
  • Update frequency: every 8.2 days
  • Top authors: stepan1010 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,513 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼1.23ms] Passed 4 tests

Analyzing server-side resources used by Motivation Generator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0746.16 ▲0.54
Dashboard /wp-admin3.38 ▲0.0756.46 ▲2.42
Posts /wp-admin/edit.php3.49 ▲0.1349.35 ▲1.34
Add New Post /wp-admin/post-new.php5.96 ▲0.0790.60 ▼9.16
Media Library /wp-admin/upload.php3.30 ▲0.0739.35 ▲2.35
Settings /wp-admin/admin.php?page=motivation-generator3.2835.15
Posters /wp-admin/admin.php?page=motivation-generator-posters3.2836.05

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 11 new files
Database: 1 new table, 14 new options
New tables
wp_mot_gen
New WordPress options
motgen_maintext_font_size
db_upgraded
can_compress_scripts
motgen_default_upload_path
motgen_destination_folder
motgen_thank_you_page
motgen_version
widget_recent-comments
motgen_default_upload_url
motgen_subtext_font_size
...

Browser metrics Passed 4 tests

A check of browser resources used by Motivation Generator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲3214.39 ▲1.121.73 ▼3.1243.75 ▲4.52
Dashboard /wp-admin2,222 ▲425.64 ▼0.0190.13 ▼2.2137.69 ▼2.58
Posts /wp-admin/edit.php2,127 ▲302.00 ▼0.0136.18 ▲0.0934.97 ▼1.40
Add New Post /wp-admin/post-new.php1,426 ▼10018.50 ▼4.51638.38 ▼60.2061.85 ▲9.44
Media Library /wp-admin/upload.php1,424 ▲244.20 ▼0.17101.21 ▼3.4144.33 ▼2.54
Settings /wp-admin/admin.php?page=motivation-generator8822.0026.9926.79
Posters /wp-admin/admin.php?page=motivation-generator-posters7001.516.7525.34

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function motgen_get_posters() in wp-content/plugins/motivation-generator/motivation-generator-admin-posters.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/motivation-generator/motivation-generator.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/motivation-generator/motivation-generator-admin-settings.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=motivation-generator
    • > Network (severe)
    https://www.paypalobjects.com/ru_RU/i/scr/pixel.gif - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: motivational, poster, motivation, motivational poster, posters...

motivation-generator/motivation-generator.php Passed 13 tests

This is the main PHP file of "Motivation Generator" version 2.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
42 characters long description:
Allows to create (de)motivational posters.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected691 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP3135119451
JavaScript26276179
CSS213061

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
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%
Functions26
▷ Named functions26100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/delete_button.png0.65KB0.54KB▼ 17.01%