Download the PHP package sectsect/google-spreadsheet-to-db without Composer

On this page you can find all versions of the php package sectsect/google-spreadsheet-to-db. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package google-spreadsheet-to-db

Google Spreadsheet to DB

PHP Unit Tests PHPStan PHP Coding Standards

The "Google Spreadsheet to DB" plugin is designed for WordPress and facilitates the import of data from Google Sheets into a WordPress database using Google's Sheets API (v4). It supports data manipulation before saving and is configurable via a WordPress admin interface.

Features

Requirements

Get Started

1. Clone this Repo into your wp-content/plugins directory.
2. Remove vendor/ in .gitignore file.
3. Install composer packages
4. Activate the plugin through the 'Plugins' menu in WordPress.

Settings

Getting Your Spreadsheet Ready for Programmatic Access

By default, a new spreadsheet cannot be accessed via Google’s API. We’ll need to go to your Google APIs console and create a new project and set it up to expose your Spreadsheets’ data.

  1. Go to the Google APIs Console.
  2. Create a new project.
  3. Click Enable API. Search for and enable the Google Sheets API.
  4. Create credentials for a Web Server to access Application Data.
  5. Name the service account and grant it a Project Role of Editor.
  6. Download the JSON file.
  7. Copy the JSON file to your app directory and rename it to client_secret.json
  8. :warning: Set client_secret.json in a location to deny web access on your server.

We now have a big chunk of authentication information, including what Google calls a client_email, which uniquely represents this OAuth service account.
Grab the value of client_email from your client_secret.json, and head back to your spreadsheet. Click the Share button in the top right, and paste the client_email value into the field to give it edit rights.
Hit send. That’s it! :ok_hand:

  1. Set the define() constants for client_secret.json in wp-config.php.

  2. Go to Settings -> Google Spreadsheet to DB on your WordPress Admin-Panel.
  3. Set the following values and save it once.
    • Data format to be stored in database
    • json_encode
    • json_encode (JSON_UNESCAPED_UNICODE)
  4. Click the Import from Google Spreadsheet button. :tada:
    • Spreadsheet ID
    • Spreadsheet name (Optional)
    • Single Sheet name
    • Top Header Row
    • Title (Optional)

Filters

Filtering the Array

You can edit the array got from Google API with add_filter( 'google_ss2db_before_save', $function_to_add ) in your functions.php before saving to database.

And also use add_filter('google_ss2db_after_save', $return_array ) to perform any processing with the return value.

APIs

Parameters

Parameter Type Notes Default Value
where array array()
relation string AND or OR AND
[array] array
key string id or date or worksheet_id or worksheet_name or sheet_name or title false
value int e.g. 3 / 2020-09-01 12:00:00 false
compare string e.g. = > < >= <= <> != =
orderby string id or date or worksheet_id or worksheet_name or sheet_name or title date
order string DESC or ASC DESC
limit int number of row to get All Data
:memo: You can also use -1 to get all data.
offset int number of row to displace or pass over 0

Usage Example

Get all rows

Get 3 rows from the 4th in ascending order by ID

Get the row with specific ID

Get 3 rows with specific Worksheet ordered by ID

Get the rows larger than or equal the specified datetime

Get the rows with multiple conditions

Notes

For Developers

Troubleshooting

Uncaught Error: Call to undefined method GuzzleHttp\Utils::chooseHandler()

Some of WordPress plugins or Composer packages you are using depend on HTTP client Guzzle v6 (legacy).
You can resolve this error by updating to v7 dependent version.

Change log

See CHANGELOG file.

License

See LICENSE file.

✌️

A little project by @sectsect


All versions of google-spreadsheet-to-db with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
google/apiclient Version ^2.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sectsect/google-spreadsheet-to-db contains the following files

Loading the files please wait ....