HTTPS Insecure Content Fixer Plugin

If you’ve got a site running on HTTPS and you try to throw in some HTTP content, the browser gets nervous. If you’ve recently made a shift to HTTPS you might notice content that was successfully embedded disappearing. If you look in the browser (right click>inspect element in Chrome), you’ll see an error like the one above. What you want in this scenario is protocol relative URLS . . . essentially a URL without the leading http/https. That lets the page load via the one protocol that matches (assuming it exists- some sites won’t supply HTTPS options).1 I ran into this problem with files we uploaded via Gravity Forms prior to the switch to HTTPS. There are a number of ways to deal with this (including search/replace at the database level) but we’re under a very heavy load at the moment and I just needed a quick fix. This solution will also allow people to do whatever they want on an ongoing basis better than a database response. This tiny little filter plugin is the result. All it does is use PHP’s preg_replace (regex) function to find any instances of HTTP or HTTPS (capital or lowercase) and remove them. I’m still amazed by regex but always end up having to spend a bit of time reminding myself of how it […]

mouse over sidebar item to get name to remove in php

Cleansing the Dashboard

Pre-Intervention Post-Intervention I’ve often had requests to make the admin dashboard in WordPress simpler for students (although it’s just as likely applicable to faculty or humans in general). The example in the Juxtapose box above (slide it!)1 The result above is an example based on one such request. The goal was to take the initial dashboard and reduce it down to the absolute minimum of items needed for students and to move them directly into the place they were likely to spend most of their time working (not the dashboard). The code below is all stuff that ends up living the functions file of the custom theme or could be incorporated into a plugin.2 This following code from here makes sure that the only posts an author sees are the ones they wrote. I’m not sure why that’s not the default but . . . The following removes menu items from the sidebar. It’s a combination of things I found in the Codex and in this post. It’s probable I can combine and simplify them but I haven’t taken the time to do that yet. Since there was one sidebar item coming from the theme/plugin, I wasn’t sure how WordPress would handle removing it. Turned out to be pretty straightforward. Mousing over the sidebar item got me the http://MYSITE.com/wp-admin/admin.php?page=vc-general and […]

Custom Fitted WordPress

flickr photo shared by Internet Archive Book Images with no copyright restriction (Flickr Commons) I’ve been doing a whole lot of WordPress customization lately for really widely varying purposes/people. It has been a lot of fun and it’s an option that I’m not sure has been conveyed well to our faculty. Many times, faculty are looking for a process for students (or one another) that is semi-structured. The students have options but they need help remembering to do certain things (include at least one image, consider these three topics, add a link, etc.) or they need a bit of guidance to help create uniformity of some sort. If you’ve ever asked more than ten people to answer three questions in an email then you know that virtually all the humans fail to follow directions when given the chance.1 You’ll also see the width and depth of human imagination if you ask someone to fill in a text field answering a question you really thought was straight forward.2 There are also concerns about the complexity of WordPress that we can address through custom post types and custom user roles while still allowing for a good deal of flexibility within our established constraints. This interplay of custom fields, custom post types, and usually a custom theme to display the former is probably […]

Lynda Tutorial Link in Rampages Dashboard Plugin

Nothing fancy here but maybe useful to someone. Based on a faculty member request, I took the WP widget API default code and created a little dashboard widget to put a link to the Lynda.com WordPress tutorials on every dashboard page (network activated). Can’t hurt and I think I’ll end up expanding this into a messaging system so I can publish “breaking” news and other useful tips.

WordPress/Google Spreadsheet Chimera Community

flickr photo shared by NASA on The Commons with no copyright restriction (Flickr Commons) Many professors don’t want students having to go into the backend of WordPress. Imagine also that you’re dealing with many hundreds of students and don’t want the hassle of people asking you about password resets or any other attendant drama. You’re willing to give up some things in return for as much simplicity as possible. You’ve got a few options for front-end editors. Gravity Forms is one I use all the time but it doesn’t give you the full WP editor which is pretty handy if you’re asking students to write posts of any complexity. AccessPress Anonymous Post Pro Forms is another option that I used on this project. It’s worth checking out and I think there’s a free version as well. Alan and Brian’s SPLOT tools are also worth checking out if your actions fit into those patterns consistently. That helps address one problem but it opens up a few other issues. We’ve got lots of students and lots of individual sections. How do we group them into courses or teams? How do we aggregate individual student’s work to their own page if they aren’t authors (in the WordPress sense)? Can we do that without drama? After a few false starts, I think this works […]

Set Default Gravity Forms From Email

On rampages we only have the ability to send out emails from rampages.us addresses. This caused a bit of confusion for me when our Gravity Forms email notifications stopped working.1 It seems like Gravity Forms now defaults to send emails from the form admin’s email address. In our case, that’s a vcu.edu domain . . . . which causes the emails to fail. You can see that when you go to Settings>Notifications for a form. The From Email now says {admin_email}. We have Gravity Forms network activated on rampages which means it’s live on all 17,000+ sites. Granted, I have no real idea how many people use it but I didn’t relish the thought of how many questions this might cause. Luckily, Gravity Forms has a way to take care of this and I was able to write a tiny, little, itsy, bitsy plugin to set the from email for all our sites. Problem solved. 1 Tim, from the ever-reliable Reclaim Hosting guided me back to sanity after I tried to make this much harder than it needed to be.

Portfolio Work – Interweaving the Personal API

I know. The title is pure click-bait. That’s part of why this blog is so wildly popular.1 I’ve been building a new portfolio site2 and I think some of this is kind of interesting even if it sounds boring. There are a few different goals in play. One challenge is to create a site that stays up to date with minimal work on my end. It’s a parallel of the small-pieces-loosely-joined mentality. I want tiny-actions-over-time (from the aforementioned small pieces) rather than widely-spaced-herculean efforts. I’m also trying to make sure that it fits in well with my current workflow and that I’m capturing the work I do elsewhere in ways that make sense. Another focus is to keep any work highly portable. I’ve had to re-enter data a number of times as I’ve migrated and I don’t want to do that any more. That’s going to be made possible mainly through some new API options and by working on my API/JSON, JavaScript skills. I’ll probably have to do chunks of it over anyway but I like to pretend I wont. I’ve got a ways to go but I’ve made some decent progress. The basic template/visuals are handled by Bootstrap. I’ve also got some simple Angular views, Timeline JS, JSON from Google sheets, WordPress WP Rest API v2, and Pinboard’s API. […]

Import Blackboard Common Cartridge into WordPress

flickr photo shared by Internet Archive Book Images with no copyright restriction (Flickr Commons) It’s far from pretty and I don’t know how well it’ll play with other courses but . . . here’s the plugin I used to import a few Blackboard course exports into WordPress. It’s nothing magical but I think it should get you most of the WordPress kind of content on courses sort of like these. It won’t pull in quizzes or anything like that and I make no attempt to map user/user roles. I just want the page content, discussion prompts, that sort of stuff. I opted to pull this content in as posts and tag them (as opposed to the Moodle import where I used Pages and parent/child relationships). It just seemed like the right path based on the content. In any case, here’s the code. It’s super ugly as I adapted some stuff I was playing around with during my Moodle attempts. It loads the xml file twice and probably does other things that will make programmers sad but honestly I was bored with it and didn’t feel it was worth re-writing. I just wanted it to work. It may also be a terrible example to set as I’m not sure I want people importing their Blackboard courses into WordPress. I do know […]

Importing Moodle into WordPress

flickr photo shared by Internet Archive Book Images with no copyright restriction (Flickr Commons) A week or two ago some faculty members asked me about getting the Leadership Education in Neurodevelopmental Disabilities (LEND) content out of the Moodle hosted at Vanderbilt and into WordPress. I figured I could do this. Someone might even have done it already. If not, I figured the export options would have to put out something fairly straightforward that could be parsed. In any case, the majority of my learning comes from committing to things I don’t quite know how to do. Turns out I couldn’t find anyone who’d done this before. I went a variety of different routes as I attempted not to do the work myself. First, I exported the course in the two different flavors that were available (SCORM1/Course Cartridge and Moodle backup). Just for fun I tried a few different flavors of import plugins . . . Edwiser Bridge might have worked but required a higher level of connection to Moodle than I felt like dealing with and seemed more focused on integration rather than migration, Simple CSV Importer and WP All Import both failed to do what I needed despite pushing XML around a bit to try to make it work. So with all the ready-made solutions exhausted2 I turned to […]