78% cartopress

Code Review | CartoPress

WordPress plugin CartoPress scored78%from 54 tests.

About plugin

  • Plugin page: cartopress
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.4
  • WordPress version: 6.3.1
  • First release: Feb 3, 2016
  • Latest release: Jun 6, 2017
  • Number of updates: 17
  • Update frequency: every 28.8 days
  • Top authors: twarrior3dc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,116 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.66MB] [CPU: ▼20.17ms] Passed 4 tests

Server-side resources used by CartoPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.24 ▼3.39
Dashboard /wp-admin3.35 ▼0.0050.51 ▼13.99
Posts /wp-admin/edit.php3.46 ▲0.1048.35 ▼2.97
Add New Post /wp-admin/post-new.php3.20 ▼2.6939.15 ▼58.93
Media Library /wp-admin/upload.php3.27 ▲0.0433.02 ▼4.37
CartoPress /wp-admin/options-general.php?page=cartopress-settings3.2827.70

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for CartoPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.48 ▼0.131.97 ▲0.3144.33 ▲2.32
Dashboard /wp-admin2,210 ▲224.87 ▼1.03118.53 ▲9.7743.12 ▼4.11
Posts /wp-admin/edit.php2,126 ▲372.05 ▲0.0236.73 ▲1.5333.22 ▲0.46
Add New Post /wp-admin/post-new.php1,539 ▲2523.09 ▲5.40652.93 ▼29.6754.07 ▲3.14
Media Library /wp-admin/upload.php1,392 ▲74.20 ▼0.0098.72 ▲1.1343.49 ▼2.56
CartoPress /wp-admin/options-general.php?page=cartopress-settings1,0252.0627.5183.31

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% 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)
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cartopress-settings
    • > Warning in wp-content/plugins/cartopress/admin/cp-settings.php+402
    Illegal string offset 'cartopress_collect_posts'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cartopress-settings
    • > Warning in wp-content/plugins/cartopress/admin/cp-settings.php+421
    Illegal string offset 'cartopress_collect_pages'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cartopress-settings
    • > Warning in wp-content/plugins/cartopress/admin/cp-settings.php+440
    Illegal string offset 'cartopress_collect_media'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cartopress-settings
    • > Warning in wp-content/plugins/cartopress/admin/cp-settings.php+269
    Illegal string offset 'cartopress_sync_postcontent'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cartopress-settings
    • > Warning in wp-content/plugins/cartopress/admin/cp-settings.php+288
    Illegal string offset 'cartopress_sync_categories'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cartopress-settings
    • > Warning in wp-content/plugins/cartopress/admin/cp-settings.php+307
    Illegal string offset 'cartopress_sync_tags'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cartopress-settings
    • > Warning in wp-content/plugins/cartopress/admin/cp-settings.php+326
    Illegal string offset 'cartopress_sync_featuredimage'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cartopress-settings
    • > Warning in wp-content/plugins/cartopress/admin/cp-settings.php+383
    Illegal string offset 'cartopress_sync_format'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cartopress-settings
    • > Warning in wp-content/plugins/cartopress/admin/cp-settings.php+364
    Illegal string offset 'cartopress_sync_author'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cartopress-settings
    • > Warning in wp-content/plugins/cartopress/admin/cp-settings.php+345
    Illegal string offset 'cartopress_sync_customfields'

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/cartopress/admin/cp-geocoderview.php:44
    • > PHP Notice
      Undefined variable: cartodb_id in wp-content/plugins/cartopress/admin/cp-geocoderview.php on line 41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/cartopress/cartopress.php:97
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/cartopress/admin/cp-options.php:19
    • > PHP Warning
      Use of undefined constant CARTOPRESS_URL - assumed 'CARTOPRESS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/cartopress/admin/cp-options.php on line 14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
  • Plugin Name: Please specify the plugin name on the first line ( === cartopress === )
The official readme.txt might help

cartopress/cartopress.php 92% from 13 tests

The main PHP script in "CartoPress" version 1.0.1 is automatically included on every request by WordPress
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 409 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin3,029 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP82367331,383
CSS4162271,055
JavaScript57042591

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity29.00
▷ Minimum class complexity7.00
▷ Maximum class complexity47.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods58
▷ Static methods2441.38%
▷ Public methods5493.10%
▷ Protected methods00.00%
▷ Private methods46.90%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
9 PNG files occupy 0.36MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/markers-shadow@2x.png1.43KB1.56KB0.00%
admin/images/logos_full_cartodb_light.png169.80KB86.69KB▼ 48.95%
admin/css/images/markers-shadow.png0.52KB0.74KB0.00%
admin/css/images/markers-matte@2x.png30.38KB10.57KB▼ 65.23%
admin/css/images/markers-soft@2x.png64.85KB16.05KB▼ 75.25%