Coder Social home page Coder Social logo

bhubr / wordpress-fake-real-text Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 192 KB

Create fake content to populate a WordPress site. Real text, no lorem ipsum. WPML-compatible.

License: GNU General Public License v2.0

PHP 84.90% CSS 3.65% JavaScript 11.45%

wordpress-fake-real-text's Introduction

Fake Real Text plugin for WordPress

This plugin generates content (posts, comments, categories, tags) in order to populate a WordPress site. It generates "real" text, not lorem ipsum.

Description

The motivation for this plugin was to create a large amount of content, in order to test my React-based WordPress theme (which is still in progress).

I gave FakerPress a try, and though it's really nice, it uses lorem ipsum, and doesn't handle multilingual content.

Since I will use this theme for a WPML-powered multilingual site, I wanted to generate posts in all active languages, not only the blog's main language.

Credits

WordPress, and web development in general, have a great community of people sharing their awesome work. Thank them all! Here are the tools that helped me get started fast.

Download, installation and usage

This section describes how to get and install the plugin, and where to go next.

Two options are available in order to install this plugin.

  1. The easy way. Since I haven't submitted it yet to the WordPress plugins repository, I made it available on my site, on this page.

    a. Get the latest plugin Zip archive. b. Change directory to your WordPress's wp-content/plugins directory. c. Unzip it.

  2. The geek way: a. Change directory to your WordPress's wp-content/plugins directory. b. Clone this repository: git clone https://github.com/bhubr/wordpress-fake-real-text.git fake-real-text. c. Run composer install. Well, of course you know about Composer.

Then you must activate it, either from WordPress's admin extensions page, or via WP-CLI.

Once done, the plugin screen is available via the "Tools >> Fake Real Text" menu entry.

Screenshot

Here's how it looks in action. Screenshot

Current status and Todo-list

  • Generate posts in current site's language
  • Generate posts in other languages
  • Clear generated contents
  • Generate comments
  • Generate categories
  • Translate

Changelog

0.3.0

  • Generate posts in all languages enabled in WPML

0.2.0

  • Initial version: generate posts in blog's main locale only

Some dev stuff (random doc for my own use)

  • Generate the Zip archive excluding .git folder: zip -x "fake-real-text/.git/*" -r fake-real-text-0.5.0.zip fake-real-text

  • How WPML works. Better explained in their docs

    • When a post is created in original lang, an entry is inserted in wp_icl_translations table. e.g. INSERT INTO wp_icl_translations VALUES (3,'post_post',1,3,'fr',NULL);. The first 3 value is for translation_id, which is the primary key for this table. The second 3 is trid is a key common to all the translations of one item. The 1 value (element_id) is the id of the item to translate (here, a post ID). The last two parameters, language_code=fr and source_language_code=NULL are for the target and source language codes. French is the main site language in my example, so source language code is NULL.
    • Upon creating an English translation through the right-hand side "Language" panel in WP's post editor, this is what gets inserted: INSERT INTO wp_icl_translations VALUES (4,'post_post',3,3,'en','fr');. Now the post ID is 3 (there's been an automatic revision of my first post created in between). trid is still 3, which makes sense, source and target languages are fr and en.

WPML icl_translations table

wordpress-fake-real-text's People

Contributors

bhubr avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.