In practice we came across with plugin Comment Image reloaded and we and our clients liked it. But in length of time we discovered some aspects of its work which we were not satisfied with or we saw them differently. In this regard we made decision to do it over “as one sees fit” and the first thing we wanted to change is size of commentators’ added photos.
Comment Images Reloaded reduces files size
Visitors will never spend time resizing image before publishing it in comments. With 100% probability user uploads file as it is stored on device. For example, if someone decides to put a picture from camera, its weight will not be less than 1 MB. Nowadays even usual “point and shoot” throws shots in 2-3 MB. Naturally, adding such heavy images affects detrimentally weight of page as a whole.
We conducted experiment. We took clean test site based on Basic template and placed article with one image on it. Page weight was 160 kB (0, 16 МB). Then added 10 comments with photos 2.4 MB each to article. Page weight was already 24.9 MB!
Such heavy weight increases load time of site, especially for users with loose Internet and can cause hangup on old computers and site load via mobile Internet will plunge user into horror and eat up lion’s share of their mobile Internet traffic.
Having thought practicability of this functionality, we decided to make our own version of plugin with ability to display images of reduced size in comments. Now our plugin Comment Images Reloaded gives administrator of resource ability to select size of displayed image in comments: small, medium, large, and full.
If using CIR convert uploaded in experiment photos to maximum size Large (1024х1024 pixels), then page weight will be only 1.2 MB instead of 25 MB and image instead of 2.4 MB will take only 0, 11 MB. It’s nice result, isn’t it?
If necessary you can select another smaller image size — Thumbnail (150х150 pixels) or Medium (300х300 pixels). In this case, weight of experimental page was 0.32 MB and 0.38 MB.
Image expansion in comments by clicking
Sizes of Thumbnai type will be appropriate not for all photos. For example, person shares his photograph of good quality, with small details or multiple objects, and it is displayed in the format 150*150 after uploading and you see practically nothing on it. Firstly, it will cause commentator’s negative emotions, secondly, photo will be useless for readers.
We took into account this moment while developing and made option of image expansion by clicking. Now you can deploy any picture on entire screen and view it in originally uploaded quality.
Limit of uploading files images by weight
After release of first versions of Comment Image Reloaded you began to ask us to increase size limit for images more than 5 MB. On reflection, we came to a conclusion that excising limitation is not always appropriate. Modern cameras take photos more than 5 MB. On the other hand, not all can allow their users to upload so volumetric images. Many site owners can be substantially limited by hosting with available space on server. This is users’ case of domestic free and budget hosting providers.
As a result, we have made tricky move and implemented functionality which allows plugin users independently define maximum weight of file for uploading images. The only limitation can be settings of hosting provider. In this case plugin checks them and displays information to administrator.
Minimum load CIR on server/hosting
Another moment which didn’t satisfy us with work of Comment Images was excessive load on server side. It turned out that while working plugin maked one request to database for each separate comment in article. It means, if there are 100 comments in article, then while loading pages plugin Comment Images will make 100 requests in database, regardless of that fact whether there are images in comments.
If additional load on server is practically not noticeable for sites with little visit or which are very rarely commented, then for large projects it can play a low-down trick play. Imagine that on site with more than 500 comments in articles several visitors simultaneously load page. It’s a few thousands of requests to database at once and, as a consequence, excessive load.
In our Comment Images Reloaded we have done work of plugin in such a manner that regardless of number of article comments, even a few millions, it makes only 2 requests to database! This increases speed of site work greatly and minimizes load on server side.
Deleting images from edit comments panel
In Comment Images for deleting image, you had to go in mediafiles, search necessary image and then delete it. Besides that process required extra efforts, it had major deficiencies.
After deleting image from mediafiles, picture in comments was deleted too, but not metadata. As a result, unpleasant empty block with frame in edit comments panel and garbage in page code remained. Naturally, sorting comments with picture, all comments were displayed which have or previously had picture.
That’s why we have not just added such button as deleting users’ added images in edit comments form but also worked out deleting process. It deletes together with image all metadata connected with it.
Pleasant details in CIR settings
At users’ request we made function of standard inscription replacement “Select image for your comment (GIF, PNG, JPG, JPEG)” on any user’s inscription.Now you can write more attractive text at your opinion or add necessary information to users.
It provides function for developers, with a help of which you can display button adding files in any place of comment form.
Disabling author’s link in plugin settings
As you may have noticed in new versions of Comment Images Reloaded link on our site appeared. It is due to our desire to extend our products as much as possible. Although the link is closed by using nofollow meta-tag, we understand that majority still prefer to get rid of it.
To avoid your getting into code and searching something there and deleting (as a result of such actions new users manage to break site) we made this function in plugin settings.
Don’t like the link- you may disable, we allow!
Minor changes and fixes
In Comment Images there was a problem with saving one image in multiple directories of hosting. In CIR there is no already such a problem.
We also fixed broken function as for prohibiting adding images to comments to all articles and made control this functionality on plugin settings page. Appropriate selection and button in Comment images was (in article editing, version 1.24), but didn’t work.
It has page with settings for convenient control plugin functionality where everything is simple and intuitively understandable.
Ability to move from Comment Images to Comment Images Reloaded (CIR)
All users of plugin Comment Images can easily and safely move to CIR. You just need to download and install our plugin CIR, deactivate Comment Images and go to CIR control settings. Then, select from list desired size images (Thumbnail, Medium, Large, Full) and click “Convert”. Comment Images Reloaded automatically finds all your photos in comments, uploaded with a help of Comment Images plugin, copies data in its settings and displays them in new format. All data Comment Images remain unchanged.