10% cinda-citizen-science

Code Review | CINDA: Volunteers Networks

WordPress plugin CINDA: Volunteers Networks scored10%from 54 tests.

About plugin

  • Plugin page: cinda-citizen-sci...
  • Plugin version: 1.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5
  • WordPress version: 6.3.1
  • First release: May 12, 2016
  • Latest release: May 26, 2017
  • Number of updates: 12
  • Update frequency: every 39.8 days
  • Top authors: iEcolab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /997 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/cinda-citizen-science/library/APP/CindaApp.php+36
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.99MB] [CPU: ▼37.84ms] Passed 4 tests

This is a short check of server-side resources used by CINDA: Volunteers Networks
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.98 ▼0.4819.89 ▼22.83
Dashboard /wp-admin3.03 ▼0.3129.63 ▼31.16
Posts /wp-admin/edit.php3.03 ▼0.3234.44 ▼14.15
Add New Post /wp-admin/post-new.php3.03 ▼2.8526.00 ▼83.22
Media Library /wp-admin/upload.php3.03 ▼0.2029.64 ▼8.08
Tracking /wp-admin/admin.php?page=cinda_tracking3.0326.15
CSV Export /wp-admin/admin.php?page=export3.0324.86
Contributions /wp-admin/edit.php?post_type=cinda_contribution3.0328.87
Configuration /wp-admin/admin.php?page=cinda_options3.0324.24
Dictionaries /wp-admin/edit.php?post_type=cinda_dictionary3.0327.27
About CINDA /wp-admin/admin.php?page=cinda_about3.0327.85
Volunteers /wp-admin/edit.php?post_type=cinda_volunteer3.0331.87
Campaigns /wp-admin/edit.php?post_type=cinda_campaign3.0326.41
Notifications /wp-admin/admin.php?page=push3.0326.85

Server storage [IO: ▲5.74MB] [DB: ▲0.02MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 202 new files
Database: 3 new tables, 7 new options
New tables
wp_cinda_trackings
wp_cinda_suscriptions
wp_cinda_model_fields
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
cinda_options
widget_recent-comments

Browser metrics Passed 4 tests

CINDA: Volunteers Networks: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,046 ▲28515.03 ▲0.651.68 ▼0.3241.90 ▲1.68
Dashboard /wp-admin2,426 ▲2206.86 ▲1.78131.07 ▲29.57102.87 ▲60.65
Posts /wp-admin/edit.php2,346 ▲2463.75 ▲1.7149.94 ▲12.9983.34 ▲49.31
Add New Post /wp-admin/post-new.php1,753 ▲22721.85 ▲4.27675.87 ▲9.1636.75 ▼18.14
Media Library /wp-admin/upload.php1,474 ▲744.59 ▲0.2987.70 ▼15.7297.07 ▲51.36
Tracking /wp-admin/admin.php?page=cinda_tracking1,0273.4547.1266.55
CSV Export /wp-admin/admin.php?page=export1,2473.4849.4279.35
Contributions /wp-admin/edit.php?post_type=cinda_contribution1,3263.8052.1666.09
Configuration /wp-admin/admin.php?page=cinda_options1,2183.4142.0271.22
Dictionaries /wp-admin/edit.php?post_type=cinda_dictionary1,3153.6949.7367.77
About CINDA /wp-admin/admin.php?page=cinda_about1,4223.4541.0789.57
Volunteers /wp-admin/edit.php?post_type=cinda_volunteer1,3063.8049.8462.97
Campaigns /wp-admin/edit.php?post_type=cinda_campaign1,3213.7049.0583.42
Notifications /wp-admin/admin.php?page=push1,6867.08135.70118.54

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-includes/class-wp-rewrite.php+1036
    A non-numeric value encountered
  • Zombie tables detected upon uninstall: 3 tables
    • wp_cinda_suscriptions
    • wp_cinda_model_fields
    • wp_cinda_trackings
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • cinda_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 117 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=push
    • > Warning in wp-includes/class-wp-rewrite.php+1038
    A non-numeric value encountered
    • > GET request to /wp-admin/admin.php?page=cinda_tracking
    • > Notice in wp-content/plugins/cinda-citizen-science/library/Cinda.php+419
    Undefined index: id
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cinda_options
    • > Notice in wp-content/plugins/cinda-citizen-science/assets/views/cinda/page_options.php+53
    Trying to access array offset on value of type bool

SRP 50% 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
Almost there! Just fix the following items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/cinda-citizen-science/templates/app/header.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_theme_support() in wp-content/plugins/cinda-citizen-science/library/global.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_footer() in wp-content/plugins/cinda-citizen-science/templates/app/footer.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cinda-citizen-science/library/CPT/functions.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cinda-citizen-science/library/APP/functions.php:48

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === cinda-citizen-science === )
You can take inspiration from this readme.txt

cinda-citizen-science/init.php 85% from 13 tests

The primary PHP file in "CINDA: Volunteers Networks" version 1.4.3 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cinda-citizen-science.php" instead of "init.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin43,092 lines of code in 159 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript574,5037,25616,932
CSS161,52276615,833
PHP551,5601,2675,657
Sass1689271,950
LESS1328341,550
SVG100655
PO File1226276515

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.40
Average class complexity28.50
▷ Minimum class complexity1.00
▷ Maximum class complexity78.00
Average method complexity3.81
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods215
▷ Static methods5324.65%
▷ Public methods20595.35%
▷ Protected methods41.86%
▷ Private methods62.79%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
16 PNG files occupy 1.46MB with 0.91MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo_ugr.png15.20KB6.02KB▼ 60.40%
assets/images/logo_osl.png10.42KB4.29KB▼ 58.82%
assets/images/logo_cinda.png55.63KB3.45KB▼ 93.79%
assets/images/button-settings.png0.98KB0.67KB▼ 30.83%
assets/images/mockup_watchface_01.png75.33KB24.12KB▼ 67.98%