This bug fix is long overdue, I admit, but it includes a laundry list of minor edgecase bug fixes. It also includes two major changes, something I would not normally put into a bugfix release.
The first major change is that the code for categories was rewritten from the ground up .This was actually in the works for the better part of a half year, or more. If there are any bugs in this release, I fully expect them to be around categories. However, in testing, everything seems to check out and work perfectly. This new code base for categories is much more performant and far, far, more flexible.
As an example of this flexibility … I was recently commissioned to make a multiple category search extension for the South Shore Coalition of Independent Therapists.
The first three drop downs are populated categories. Each drop down represents the children of a parent category. The ability to search by multiple categories allows those seeking a therapist to easily narrow the search to those that meet their specific need.
Oh, I almost forgot. This does fix a longstanding bug where the category counts included entries in the moderation queue or were set to unlisted. This will no longer be added to the count.
The second major change is when images are uploaded they are now automagically scaled down so they are no larger than 1920x1080px. This size was chosen because it covers the vast majority of screen sizes currently in use. This should prevent wasted server resources. For webmasters, sys admins and advanced users, I made sure the default image size can be adjusted or even completely disabled. I’ll be putting up a doc page on how to do that in the next couple days.
Here’s a quick overview of what other issues this release fixes:
- Fixed the “Warning: Cannot use a scalar value as an array” error. This error was shown to users when their web host does not have an image processing library installed on the web server. This error should no longer be shown, however, Connections will not be able to dynamically resize images. A notice in the admin will still be displayed, “The server does not have ImageMagick or GD installed and/or enabled. Either of these are required for WordPress to be able to resize images. Please contact your server administrator.” If you see this notice, you will have to contact your web host and request that they install the GD image processing library.
- White screen when uploading an image. This, I believe, is being caused by an older version of the Imagick image processing library. The older version does not contain a required function and will cause a fatal error when Connections tries to use it. This causes the white screen. To address this, Connections no longer uses that function.
- Add input attribute accept=”image/*” to both the image and logo upload fields.
- Fix bug with image URL/s when the protocol is https so they are served securely.
- Ensure that the path and URL to images are updated to the current path to account for moving sites or changing the site’s folder structure.
- Ensure subdir is prefixed with a forward slash in cnUpload::subDirectory(). Since it is now being prepended with a forward slash both path and url needed to be untrailingslashit() so the paths are correct when the two are joined with subdir(). This was done to remain consistent with WP core.
- Fix bug that would copy any images from the `connections-images` folder to the {entry-slug} folder when adding an entry.
- Prevent selection of files that are too large to be uploaded.
- Add actions/filters to cnImage::upload().
- Ensure other plugins can not override the upload path in cnUpload::File().
- Add missing stylesheet for datepicker in metabox API.
- Ensure lat/lng are properly formatted preventing PHP from localizing it.
- Compatibility fix to prevent s2member from resetting the custom roles and capabilities.
- Include the Dashboard admin page templates only in the admin.
- Only load the System Dashboard widget if the current user can manage options.
- Fix admin dashboard admin widgets so the so the correct date ranges.
- Update and add several translations supplied by volunteers.
- Allow cnRetrieve::entries() to return results with status ‘pending’ for users with the edit moderated capability.
- Allow the ‘cn_edit_entry_form’ action to be fired if the user’s entry status is approved or pending.
- Show the edit entry adminbar link if the entry status is approved or pending if the user has either edit or edit moderated capabilities.
- Add additional countries and regions to cnGeo.
- Introduce cnFragment::clear().
- Introduce CN_Walker_Category_List.
- Introduce cnImage::maxSize().
- Introduce cnSanitize::args().
- Introduce cnFormatting::replaceWhatWith() and cnFormatting::normalizeString().
- Add get permalink methods to both cnEntry (returns) and cnOutput (echos). Moved directoryHome page to cnEntry.
- Refactor cnEntry::set().
- Refactor cnEntry::getName().
- Refactor cnOutput::getNameBlock().
- Refactor cnOutput::getFamilyMemberBlock().
- Refactor cnRetrieve::upcoming().
- Refactor portions of cnRetrieve::entries() to be cleaner and more efficient.
- Remove unused global var from cnOutput::getNameBlock().
- Init the template API on the `plugins_loaded` action hook.
- Update EDD-SL Updater to 1.6.
- Add the $value options to cnTemplatePart::categorySelect() so the SELECTED options can be set rather than rely on query vars.
- Remove unused local vars in cnAdminActions.
- Remove several deprecated image related functions.
- Fix undefined index errors.
- Fix a lot of misspellings in the code inline docs.
- Fix a lot of phpDoc errors.
Yeah, that’s a long list … I even shortened it.