10% wp-collectiveaccess

Code Review | WP-CollectiveAccess

WordPress plugin WP-CollectiveAccess scored10%from 54 tests.

About plugin

  • Plugin page: wp-collectiveaccess
  • Plugin version: 0.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-3.9
  • WordPress version: 6.3.1
  • First release: Jul 15, 2014
  • Latest release: Aug 5, 2014
  • Number of updates: 20
  • Update frequency: every 1.3 days
  • Top authors: gautiermichelin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,383 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/wp-collectiveaccess/widget_search_form.php+15
    Methods with the same name as their class will not be constructors in a future version of PHP; search_form_widget has a deprecated constructor

Server metrics [RAM: ▼1.64MB] [CPU: ▼56.32ms] Passed 4 tests

Server-side resources used by WP-CollectiveAccess
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.35 ▼1.127.33 ▼43.44
Dashboard /wp-admin2.37 ▼0.948.50 ▼48.70
Posts /wp-admin/edit.php2.37 ▼0.9910.75 ▼41.60
Add New Post /wp-admin/post-new.php2.37 ▼3.528.75 ▼91.52
Media Library /wp-admin/upload.php2.37 ▼0.8611.56 ▼24.88
CollectiveAccess /wp-admin/options-general.php?page=collectiveaccess2.3712.04

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 111 new files
Database: 1 new table, 10 new options
New tables
wp_collectiveaccess_cache
New WordPress options
wpca_version
collectiveaccess_options
theysaidso_admin_options
widget_browse_links_widget
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
widget_search_form_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-CollectiveAccess
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.67 ▼0.585.42 ▲3.5143.84 ▼0.35
Dashboard /wp-admin2,207 ▲195.82 ▲0.93107.50 ▼16.0548.84 ▲5.80
Posts /wp-admin/edit.php2,093 ▲41.98 ▼0.0336.94 ▼1.3636.94 ▲4.22
Add New Post /wp-admin/post-new.php1,517 ▼1623.86 ▲0.61652.29 ▲9.5575.88 ▲20.35
Media Library /wp-admin/upload.php1,392 ▲74.23 ▲0.04114.88 ▲1.9247.36 ▲0.53
CollectiveAccess /wp-admin/options-general.php?page=collectiveaccess9022.0623.4838.58

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/wp-collectiveaccess/widget_search_form.php+15
    Methods with the same name as their class will not be constructors in a future version of PHP; search_form_widget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_collectiveaccess_cache
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_search_form_widget
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • wpca_version
    • widget_recent-comments
    • db_upgraded
    • widget_browse_links_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > Deprecated in wp-content/plugins/wp-collectiveaccess/widget_search_form.php+15
    Methods with the same name as their class will not be constructors in a future version of PHP; search_form_widget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > Deprecated in wp-content/plugins/wp-collectiveaccess/widget_browse_links.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; browse_links_widget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in search_form_widget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in browse_links_widget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > Notice in wp-content/plugins/wp-collectiveaccess/collectiveaccess_settings.php+116
    Undefined index: empty_cache
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > Notice in wp-content/plugins/wp-collectiveaccess/collectiveaccess_settings.php+159
    Undefined index: place_template
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > Notice in wp-content/plugins/wp-collectiveaccess/collectiveaccess_settings.php+167
    Undefined index: occurrence_template
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > Notice in wp-content/plugins/wp-collectiveaccess/collectiveaccess_settings.php+175
    Undefined index: collection_template
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=collectiveaccess
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-collectiveaccess/tilepic.php
    • > /wp-content/plugins/wp-collectiveaccess/collectiveaccess_ajax_handler.php
  • 41× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-collectiveaccess/views/collectiveaccess_js.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-collectiveaccess/widget_random_object.php:8
    • > PHP Warning
      include(_DIR__/collectiveaccess_js.php): failed to open stream: No such file or directory in wp-content/plugins/wp-collectiveaccess/views/collectiveaccess_browse_js.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-collectiveaccess/collectiveaccess_object_detail.php:9
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-collectiveaccess/views/collectiveaccess_thumbnail_html.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-collectiveaccess/views/collectiveaccess_search_html.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-collectiveaccess/views/collectiveaccess_detail_linked_object_html.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-collectiveaccess/views/collectiveaccess_js.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-collectiveaccess/widget_search_form.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-collectiveaccess/views/collectiveaccess_pagination_html.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: collectiveaccess, tilepic, webservices, museum, media...

wp-collectiveaccess/WP-CollectiveAccess.php 92% from 13 tests

The main PHP script in "WP-CollectiveAccess" version 0.5.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-collectiveaccess.php" instead of "WP-CollectiveAccess.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin5,708 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript76024372,575
PHP493464272,094
CSS39354665
PO File285174223
Markdown2570118
Bourne Shell1151233

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.60
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes16.67%
▷ Concrete classes1493.33%
▷ Final classes00.00%
Methods48
▷ Static methods00.00%
▷ Public methods4797.92%
▷ Protected methods00.00%
▷ Private methods12.08%
Functions59
▷ Named functions5593.22%
▷ Anonymous functions46.78%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
36 PNG files occupy 1.42MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/captures/search_small.png70.62KB22.44KB▼ 68.22%
assets/images/pan_on.png0.41KB0.31KB▼ 23.74%
assets/images/zoom_out.png0.37KB0.30KB▼ 18.35%
js/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
js/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%