72% catablog

Code Review | CataBlog

WordPress plugin CataBlog scored72%from 54 tests.

About plugin

  • Plugin page: catablog
  • Plugin version: 1.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.3
  • WordPress version: 6.3.1
  • First release: Apr 9, 2010
  • Latest release: Nov 21, 2019
  • Number of updates: 268
  • Update frequency: every 13.1 days
  • Top authors: macguru2000 (100%)

Code review

54 tests

User reviews

38 reviews

Install metrics

1,000+ active /176,715 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.67MB] [CPU: ▼38.52ms] Passed 4 tests

A check of server-side resources used by CataBlog
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.24 ▲0.7730.71 ▼8.88
Dashboard /wp-admin3.28 ▼0.0318.00 ▼30.36
Posts /wp-admin/edit.php3.28 ▼0.0817.06 ▼27.84
Add New Post /wp-admin/post-new.php3.28 ▼2.6117.69 ▼79.60
Media Library /wp-admin/upload.php3.28 ▲0.0517.64 ▼16.28
Delete Gallery /wp-admin/admin.php?page=catablog-gallery-delete3.2921.67
Unlock Folders /wp-admin/admin.php?page=catablog-unlock-folders4.0535.72
Remove /wp-admin/admin.php?page=catablog-remove4.0431.64
Add New /wp-admin/admin.php?page=catablog-upload4.0534.94
Create /wp-admin/admin.php?page=catablog-create3.9730.50
Templates /wp-admin/admin.php?page=catablog-templates4.0535.61
Delete Template /wp-admin/admin.php?page=catablog-templates-delete4.0533.19
Lock Folders /wp-admin/admin.php?page=catablog-lock-folders4.0535.63
Delete /wp-admin/admin.php?page=catablog-delete4.0533.14
Append To Gallery /wp-admin/admin.php?page=catablog-gallery-append3.9730.44

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 74 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
widget_recent-comments
catablog-options
widget_catablogcategorywidget
widget_recent-posts
widget_catablogwidget
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for CataBlog
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,927 ▲16614.35 ▲0.052.09 ▲0.4843.98 ▲3.37
Dashboard /wp-admin2,269 ▲985.57 ▼0.0989.31 ▲3.4576.81 ▲32.20
Posts /wp-admin/edit.php2,174 ▲742.02 ▲0.0235.69 ▼3.4537.74 ▲4.41
Add New Post /wp-admin/post-new.php1,607 ▲8123.20 ▲0.20763.08 ▲99.5855.86 ▲0.59
Media Library /wp-admin/upload.php1,471 ▲744.19 ▼0.08106.76 ▲8.6578.66 ▲34.42
Delete Gallery /wp-admin/admin.php?page=catablog-gallery-delete8611.9036.9126.17
Unlock Folders /wp-admin/admin.php?page=catablog-unlock-folders7401.3614.7418.48
Remove /wp-admin/admin.php?page=catablog-remove7621.516.6616.53
Add New /wp-admin/admin.php?page=catablog-upload1,0311.9029.4336.53
Create /wp-admin/admin.php?page=catablog-create9691.8527.6233.98
Templates /wp-admin/admin.php?page=catablog-templates1,1331.9629.1635.73
Delete Template /wp-admin/admin.php?page=catablog-templates-delete8611.8426.4323.42
Lock Folders /wp-admin/admin.php?page=catablog-lock-folders7401.516.5914.10
Delete /wp-admin/admin.php?page=catablog-delete8581.9224.6122.74
Append To Gallery /wp-admin/admin.php?page=catablog-gallery-append1,3841.8528.6230.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • Zombie WordPress options were found after uninstall: 9 options
    • can_compress_scripts
    • widget_catablogwidget
    • theysaidso_admin_options
    • catablog-options
    • widget_catablogcategorywidget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% 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=catablog-gallery-delete
    • > Notice in wp-includes/taxonomy.php+3039
    Undefined property: WP_Taxonomy::$taxonomy
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=catablog-gallery-append
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=catablog-create
    • > Notice in wp-content/plugins/catablog/lib/CataBlog.class.php+1314
    Undefined index: _catablog_create_nonce
    • > GET request to /wp-admin/admin.php?page=catablog-gallery-append
    • > Notice in wp-content/plugins/catablog/lib/CataBlog.class.php+1252
    Undefined index: _catablog_append_gallery_nonce
    • > GET request to /wp-admin/admin.php?page=catablog-gallery-append
    • > Notice in wp-content/plugins/catablog/templates/admin-library.php+51
    Trying to get property 'term_id' of non-object

SRP 0% 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
The following issues need your attention
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/catablog/lib/catablog.upload.php
    • > /wp-content/plugins/catablog/templates/widget-javascript.php
    • > /wp-content/plugins/catablog/templates/admin-export.php
    • > /wp-content/plugins/catablog/catablog.php
  • 34× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/catablog/lib/CataBlogWidget.class.php:11
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/catablog/templates/admin-export.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/catablog/templates/admin-rescan.php:3
    • > PHP Notice
      Undefined variable: screen in wp-content/plugins/catablog/templates/admin-contextual-help.php on line 102
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/catablog/templates/admin-import.php:3
    • > PHP Notice
      Undefined variable: screen in wp-content/plugins/catablog/templates/admin-contextual-help.php on line 94
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/catablog/templates/admin-options.php:3
    • > PHP Notice
      Undefined variable: screen in wp-content/plugins/catablog/templates/admin-contextual-help.php on line 86
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/catablog/templates/admin-library.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/catablog/templates/admin-screen-options-add-new.php:4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Use the list view for a bird's eye of the entire catalog.), #2 (Use the grid view for bigger thumbnails and easier sorting.), #3 (Easy and familiar forms for making and editing catalog items.), #4 (Turn your catalog into a photo gallery using custom templates.), #5 (Display your catalog photos in high resolution with the LightBox.), #6 (CataBlog is now localized for Español.)
  • Tags: Please reduce the number of tags, currently 25 tag instead of maximum 10
You can look at the official readme.txt

catablog/catablog.php 92% from 13 tests

This is the main PHP file of "CataBlog" version 1.7.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 146 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin15,722 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PO File63,0953,9757,285
PHP292,0937726,577
CSS2236351,164
JavaScript221828647
HTML55049

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity108.50
▷ Minimum class complexity7.00
▷ Maximum class complexity478.00
Average method complexity4.15
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods201
▷ Static methods83.98%
▷ Public methods16180.10%
▷ Protected methods00.00%
▷ Private methods4019.90%
Functions9
▷ Named functions666.67%
▷ Anonymous functions333.33%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sortable_handle.png1.22KB0.34KB▼ 71.99%
images/upload.png1.93KB1.10KB▼ 43.17%
images/catablog-icon-16.png1.12KB1.08KB▼ 3.48%
images/catablog-icon-32.png2.05KB1.74KB▼ 15.03%
images/catablog-admin-select-image.png2.01KB1.11KB▼ 44.73%