janboddez / import-bookmarks Goto Github PK
View Code? Open in Web Editor NEWImport HTML bookmarks files into WordPress.
Home Page: https://jan.boddez.net/wordpress/import-bookmarks
License: GNU General Public License v3.0
Import HTML bookmarks files into WordPress.
Home Page: https://jan.boddez.net/wordpress/import-bookmarks
License: GNU General Public License v3.0
Uploading an invalid file will result in a 'white screen of death', or rather, cause PHP to exit. In fact, all return;
lines inside the import()
function should really be replaced with something like wp_redirect( admin_url( 'tools.php?page=import-bookmarks&message=warning' ) ); exit;
. Upon being redirected, the user should then be shown at a least a warning that something went wrong.
See also Strategy11/formidable-forms@0f11333
Due to an undefined $post_types
array in the import function.
The set_time_limit( 0 );
inside the import()
method should probably go and may actually not be needed. On a temporary shared hosting setup, the plugin is able to process a few hundred bookmarks in well under 10 seconds (the typical PHP timeout is 30 seconds).
If PHP does choke on larger sets of bookmarks, though, the 'final' solution would likely be to have JavaScript send 'chunks' of 10 or so bookmarks off to the server one by one. (This has the added benefit of being able to show a progress bar.)
I noticed, while testing the plugin, that it create posts that end up creating the default post content. We could add "links" in case the "block editor" is active in the WordPress instance.
Let me know if this is something that you consider for this plugin.
If an HTML file containing no bookmarks at all is uploaded, this results in a couple of PHP Warnings, while the user still sees a success message. Better check ! empty( $bookmarks ) && is_array( $bookmarks )
and either wp_die()
or update the notice.
The import_bookmarks_uri
custom field may be used to detect duplicate URLs for post types that support custom fields. An option to detect duplicate entries this way should be switchable, however. (There may be valid reasons to link to the same web page more than once.)
As a user, I would like to be able to integrate this bookmark with an API that is cross browser and cross platform. Firefox uses for itself Pocket by default, and that is a very interesting option for bookmarking technologies.
Because Pocket has an API, we could use it, so the user could also import from there.
Let me know your thoughts.
The included parser is, apparently, not platform-independent: https://wordpress.org/support/topic/you-can-make-it-work-with-last-version-of-wordpress-5-6-2/
It'd be cool if one could list sites that should never be imported without having to manually trim export files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.