78% captionpix

Code Review | CaptionPix

WordPress plugin CaptionPix scored78%from 54 tests.

About plugin

  • Plugin page: captionpix
  • Plugin version: 1.8
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.4
  • WordPress version: 6.3.1
  • First release: Sep 24, 2011
  • Latest release: Apr 26, 2020
  • Number of updates: 33
  • Update frequency: every 95.1 days
  • Top authors: powerblogservice (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /15,633 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.52MB] [CPU: ▲0.78ms] Passed 4 tests

Analyzing server-side resources used by CaptionPix
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3444.36 ▲2.00
Dashboard /wp-admin3.88 ▲0.5752.23 ▲4.19
Posts /wp-admin/edit.php3.99 ▲0.6453.31 ▲6.23
Add New Post /wp-admin/post-new.php6.46 ▲0.5787.52 ▼5.52
Media Library /wp-admin/upload.php3.80 ▲0.5739.05 ▲2.44
Dashboard (v1.8) /wp-admin/admin.php?page=captionpix3.7736.25
Settings /wp-admin/admin.php?page=captionpix-core3.7935.33
Themes /wp-admin/admin.php?page=captionpix-theme3.7638.25
License /wp-admin/admin.php?page=captionpix-api3.7837.05

Server storage [IO: ▲0.66MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 48 new files
Database: no new tables, 7 new options
New WordPress options
captionpix_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for CaptionPix
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲10013.23 ▼1.331.73 ▼0.1042.43 ▼8.37
Dashboard /wp-admin2,244 ▲534.82 ▼0.22110.80 ▲3.1142.34 ▼0.90
Posts /wp-admin/edit.php2,127 ▲352.03 ▼0.0238.37 ▼1.7934.96 ▲2.69
Add New Post /wp-admin/post-new.php1,570 ▲3618.24 ▼4.89592.89 ▼75.3051.77 ▲0.72
Media Library /wp-admin/upload.php1,426 ▲444.19 ▼0.0395.86 ▼1.3241.43 ▼2.56
Dashboard (v1.8) /wp-admin/admin.php?page=captionpix9122.2125.6329.86
Settings /wp-admin/admin.php?page=captionpix-core1,2122.2564.6261.11
Themes /wp-admin/admin.php?page=captionpix-theme1,0012.2136.8729.99
License /wp-admin/admin.php?page=captionpix-api1,0752.3040.2038.52

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • captionpix_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=captionpix-theme
    • > Warning in wp-content/plugins/captionpix/classes/class-theme.php+39
    count(): Parameter must be an array or an object that implements Countable

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Captionpix_Module' not found in wp-content/plugins/captionpix/classes/class-theme.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Captionpix_Module' not found in wp-content/plugins/captionpix/classes/class-api.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Captionpix_Admin' not found in wp-content/plugins/captionpix/classes/class-api-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Captionpix_Module' not found in wp-content/plugins/captionpix/classes/class-core.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Captionpix_Admin' not found in wp-content/plugins/captionpix/classes/class-core-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Captionpix_Admin' not found in wp-content/plugins/captionpix/classes/class-theme-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Captionpix_Admin' not found in wp-content/plugins/captionpix/classes/class-dashboard.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots lack descriptions #2, #3 in captionpix/assets to your readme.txt
Please take inspiration from this readme.txt

captionpix/main.php 92% from 13 tests

"CaptionPix" version 1.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("captionpix.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,486 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP17361282,291
CSS670122
JavaScript32373

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity34.53
▷ Minimum class complexity1.00
▷ Maximum class complexity178.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity70.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes213.33%
▷ Concrete classes1386.67%
▷ Final classes00.00%
Methods273
▷ Static methods10.37%
▷ Public methods24288.64%
▷ Protected methods10.37%
▷ Private methods3010.99%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants17
▷ Global constants1588.24%
▷ Class constants211.76%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
10 PNG files occupy 0.28MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/captionpix-icon.png0.69KB0.98KB0.00%
borders/grunge.png33.64KB17.54KB▼ 47.86%
images/tick.png0.52KB0.52KB0.00%
borders/chain.png6.10KB3.32KB▼ 45.56%
images/get-free-license-key.png50.91KB15.16KB▼ 70.23%